diff options
Diffstat (limited to 'lib/file.c')
-rw-r--r-- | lib/file.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/file.c b/lib/file.c index 7e55bd6db..3d1d2bbcb 100644 --- a/lib/file.c +++ b/lib/file.c @@ -95,6 +95,12 @@ #define DOS_FILESYSTEM 1 #endif +#ifdef OPEN_NEEDS_ARG3 +# define open_readonly(p,f) open((p),(f),(0)) +#else +# define open_readonly(p,f) open((p),(f)) +#endif + /* * Forward declarations. */ @@ -251,10 +257,10 @@ static CURLcode file_connect(struct connectdata *conn, bool *done) if(actual_path[i] == '/') actual_path[i] = '\\'; - fd = open(actual_path, O_RDONLY | O_BINARY); /* no CR/LF translation! */ + fd = open_readonly(actual_path, O_RDONLY|O_BINARY); /* no CR/LF translation */ file->path = actual_path; #else - fd = open(real_path, O_RDONLY); + fd = open_readonly(real_path, O_RDONLY); file->path = real_path; #endif file->freepath = real_path; /* free this when done */ |