From 18c95d4bc0bb930759927b74d930410786081eec Mon Sep 17 00:00:00 2001 From: Marc Hoersken Date: Wed, 23 Dec 2015 13:04:00 +0100 Subject: tftpd server: add Windows support by writing files in binary mode --- tests/server/tftpd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index c2c512f11..ffc2496d6 100644 --- a/tests/server/tftpd.c +++ b/tests/server/tftpd.c @@ -565,7 +565,11 @@ static ssize_t write_behind(struct testcase *test, int convert) if(!test->ofile) { char outfile[256]; snprintf(outfile, sizeof(outfile), "log/upload.%ld", test->testno); +#ifdef WIN32 + test->ofile=open(outfile, O_CREAT|O_RDWR|O_BINARY, 0777); +#else test->ofile=open(outfile, O_CREAT|O_RDWR, 0777); +#endif if(test->ofile == -1) { logmsg("Couldn't create and/or open file %s for upload!", outfile); return -1; /* failure! */ -- cgit v1.2.3