diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-11-04 22:02:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-04 22:02:41 +0100 |
commit | 60c78726a599c0154ba6473e48cf31792dedeb71 (patch) | |
tree | 91bbc2ec8bb8d66bea06d6cc99474ff6b0f815bd /thirdparty/libwebsockets/plat/lws-plat-unix.c | |
parent | 91d158afb233b1cd273a880609be6a33e9f11458 (diff) | |
parent | 3703655ce2cf310db61608fb492b0354db611a8d (diff) |
Merge pull request #23478 from Faless/lws_3.0.1_pr
Update libwebsocket to 3.0.1
Diffstat (limited to 'thirdparty/libwebsockets/plat/lws-plat-unix.c')
-rw-r--r-- | thirdparty/libwebsockets/plat/lws-plat-unix.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/thirdparty/libwebsockets/plat/lws-plat-unix.c b/thirdparty/libwebsockets/plat/lws-plat-unix.c index bacc6af647..7dba3bd82f 100644 --- a/thirdparty/libwebsockets/plat/lws-plat-unix.c +++ b/thirdparty/libwebsockets/plat/lws-plat-unix.c @@ -30,6 +30,12 @@ #endif #include <dirent.h> +void lws_plat_apply_FD_CLOEXEC(int n) +{ + if (n != -1) + fcntl(n, F_SETFD, FD_CLOEXEC ); +} + int lws_plat_socket_offset(void) { @@ -330,6 +336,8 @@ lws_plat_set_socket_options(struct lws_vhost *vhost, int fd) struct protoent *tcp_proto; #endif + fcntl(fd, F_SETFD, FD_CLOEXEC); + if (vhost->ka_time) { /* enable keepalive on this socket */ optval = 1; @@ -952,7 +960,7 @@ lws_plat_write_file(const char *filename, void *buf, int len) LWS_VISIBLE int lws_plat_read_file(const char *filename, void *buf, int len) { - int n, fd = open(filename, O_RDONLY); + int n, fd = lws_open(filename, O_RDONLY); if (fd == -1) return -1; |