From 00883822be245d2660a569e6bde38892b9433aa2 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Thu, 4 Jun 2009 19:11:11 +0000 Subject: allow building libcurl for VxWorks --- lib/file.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lib/file.c') 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 */ -- cgit v1.2.3