← Commit list

462244447e

Viktor Szakats
Viktor Szakats
2026-02-04
SUCCESS Duration: 322s

Subject

build: use native file open flags in Windows-specific code

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

.github/scripts/typos.toml+1 -1
@@ -11,7 +11,7 @@ extend-ignore-identifiers-re = [
"^0x[0-9a-fA-F]+FUL$", # unsigned long hex literals ending with 'F'
"^(eyeballers|HELO_smtp|Januar|optin|passin|perfec|SMTP_HELO)$",
"^(clen|req_clen|smtp_perform_helo|smtp_state_helo_resp|Tru64|_stati64)$",
- "(ccontains|controllen|secur32)",
+ "(_ccontains|_controllen|O_WRONLY|secur32)",
"proxys", # this should be limited to tests/http/*. Short for secure proxy.
]
lib/curl_fopen.c+2 -2
@@ -125,8 +125,8 @@ CURLcode Curl_fopen(struct Curl_easy *data, const char *filename,
result = CURLE_WRITE_ERROR;
#ifdef _WIN32
- fd = curlx_open(tempstore, O_WRONLY | O_CREAT | O_EXCL,
- S_IREAD | S_IWRITE);
+ fd = curlx_open(tempstore, _O_WRONLY | _O_CREAT | _O_EXCL,
+ _S_IREAD | _S_IWRITE);
#elif (defined(ANDROID) || defined(__ANDROID__)) && \
(defined(__i386__) || defined(__arm__))
fd = curlx_open(tempstore, O_WRONLY | O_CREAT | O_EXCL,
lib/curl_setup.h+3 -1
@@ -864,7 +864,9 @@
/* Since O_BINARY is used in bitmasks, setting it to zero makes it usable in
source code but yet it does not ruin anything */
-#ifdef O_BINARY
+#ifdef _O_BINARY /* for _WIN32 */
+#define CURL_O_BINARY _O_BINARY
+#elif defined(O_BINARY)
#define CURL_O_BINARY O_BINARY
#else
#define CURL_O_BINARY 0
src/tool_cb_wrt.c+1 -1
@@ -29,7 +29,7 @@
#include "tool_operate.h"
#ifdef _WIN32
-#define OPENMODE S_IREAD | S_IWRITE
+#define OPENMODE _S_IREAD | _S_IWRITE
#else
#define OPENMODE S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
#endif
tests/server/tftpd.c+1 -1
@@ -420,7 +420,7 @@ static ssize_t write_behind(struct testcase *test, int convert)
snprintf(outfile, sizeof(outfile), "%s/upload.%ld", logdir, test->testno);
test->ofile = curlx_open(outfile, O_CREAT | O_RDWR | CURL_O_BINARY,
#ifdef _WIN32
- S_IREAD | S_IWRITE
+ _S_IREAD | _S_IWRITE
#else
S_IRUSR | S_IWUSR | S_IXUSR |
S_IRGRP | S_IWGRP | S_IXGRP |
tests/server/util.c+2 -2
@@ -333,8 +333,8 @@ static void exit_signal_handler(int signum)
else {
int fd = -1;
#ifdef _WIN32
- if(!_sopen_s(&fd, serverlogfile, O_WRONLY | O_CREAT | O_APPEND,
- _SH_DENYNO, S_IREAD | S_IWRITE) &&
+ if(!_sopen_s(&fd, serverlogfile, _O_WRONLY | _O_CREAT | _O_APPEND,
+ _SH_DENYNO, _S_IREAD | _S_IWRITE) &&
fd != -1) {
#else
/* !checksrc! disable BANNEDFUNC 1 */