From: Marc Hoersken Date: Wed, 23 Dec 2015 12:04:00 +0000 (+0100) Subject: tftpd server: add Windows support by writing files in binary mode X-Git-Tag: curl-7_47_0~63 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=18c95d4bc0bb930759927b74d930410786081eec;p=thirdparty%2Fcurl.git tftpd server: add Windows support by writing files in binary mode --- diff --git a/tests/server/tftpd.c b/tests/server/tftpd.c index c2c512f11e..ffc2496d60 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! */