aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2015-12-23 13:04:00 +0100
committerMarc Hoersken <info@marc-hoersken.de>2015-12-23 13:04:00 +0100
commit18c95d4bc0bb930759927b74d930410786081eec (patch)
tree56493ea8b0d9a393e2e0632e9bb3a54ca51f242b /tests
parent328771981a4c08eb6a0fe41e5ea04bc39086b045 (diff)
tftpd server: add Windows support by writing files in binary mode
Diffstat (limited to 'tests')
-rw-r--r--tests/server/tftpd.c4
1 files changed, 4 insertions, 0 deletions
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! */