summaryrefslogtreecommitdiff
path: root/util-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-02-11 21:17:18 -0500
committerNick Mathewson <nickm@torproject.org>2012-02-11 21:17:18 -0500
commit03dce42dfa0380a96bdfc2e9c18b15318ec0ba5b (patch)
tree23c9b234d68c311ab2ae79b88b9d4973b01f4ecf /util-internal.h
parentd2b5f7223abe4825410392a54ac34dc973465faf (diff)
downloadlibevent-03dce42dfa0380a96bdfc2e9c18b15318ec0ba5b.tar.gz
Tweak the evutil_open_closeonexec patch to work on windows, old unixes.
Windows doesn't have a mode_t as far as I can tell. Some unixes, iirc, don't like three-argument open without O_CREAT.
Diffstat (limited to 'util-internal.h')
-rw-r--r--util-internal.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/util-internal.h b/util-internal.h
index d09aa471..47fe962d 100644
--- a/util-internal.h
+++ b/util-internal.h
@@ -161,7 +161,10 @@ char EVUTIL_TOLOWER(char c);
#define EVUTIL_UPCAST(ptr, type, field) \
((type *)(((char*)(ptr)) - evutil_offsetof(type, field)))
-int evutil_open_closeonexec(const char *pathname, int flags, mode_t mode);
+/* As open(pathname, flags, mode), except that the file is always opened with
+ * the close-on-exec flag set. (And the mode argument is mandatory.)
+ */
+int evutil_open_closeonexec(const char *pathname, int flags, unsigned mode);
int evutil_read_file(const char *filename, char **content_out, size_t *len_out,
int is_binary);