tidy-up: extend CURL_O_BINARY to lib and tests

Move `CURL_O_BINARY` definition from src to lib and use it from lib and
tests code.

Closes #16009
This commit is contained in:
Viktor Szakats 2025-01-15 10:52:02 +01:00
parent c5bb4e77e4
commit f07612cd9a
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
5 changed files with 14 additions and 29 deletions

View file

@ -454,11 +454,7 @@ static ssize_t write_behind(struct testcase *test, int convert)
if(!test->ofile) {
char outfile[256];
msnprintf(outfile, sizeof(outfile), "%s/upload.%ld", logdir, 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
test->ofile = open(outfile, O_CREAT|O_RDWR|CURL_O_BINARY, 0777);
if(test->ofile == -1) {
logmsg("Couldn't create and/or open file %s for upload!", outfile);
return -1; /* failure! */