diff options
author | Ross Lagerwall <rosslagerwall@gmail.com> | 2012-02-11 17:23:17 +0200 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-02-11 21:10:22 -0500 |
commit | d2b5f7223abe4825410392a54ac34dc973465faf (patch) | |
tree | 83b4d219f12e21313d07d67c6428590361bbb4e5 /util-internal.h | |
parent | 0c483170be2f447c6d1d1cfe103506976e1523d4 (diff) | |
download | libevent-d2b5f7223abe4825410392a54ac34dc973465faf.tar.gz |
Make uses of open() close-on-exec safe by introducing evutil_open_closeonexec.
In a multi-process/threaded environment, opening fds internally
without the close-on-exec flag could leak fds to child processes.
Diffstat (limited to 'util-internal.h')
-rw-r--r-- | util-internal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/util-internal.h b/util-internal.h index d51bc000..d09aa471 100644 --- a/util-internal.h +++ b/util-internal.h @@ -161,6 +161,8 @@ 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); + int evutil_read_file(const char *filename, char **content_out, size_t *len_out, int is_binary); |