diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-01-13 12:38:26 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-01-13 12:38:26 +0400 |
commit | bf1ccc7f6e7a9dc5a8ba3d8d02b25ad446458840 (patch) | |
tree | 4e53a7f2990e40436f6ae98434f72c3db14434c0 /accel-pppd/cli | |
parent | 03a466f1b0f7549c2ef89c1e544c2c86c3958ad4 (diff) | |
download | accel-ppp-bf1ccc7f6e7a9dc5a8ba3d8d02b25ad446458840.tar.gz accel-ppp-bf1ccc7f6e7a9dc5a8ba3d8d02b25ad446458840.zip |
set FD_CLOEXEC on opened file descriptors
Diffstat (limited to 'accel-pppd/cli')
-rw-r--r-- | accel-pppd/cli/tcp.c | 2 | ||||
-rw-r--r-- | accel-pppd/cli/telnet.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/accel-pppd/cli/tcp.c b/accel-pppd/cli/tcp.c index fea0e4e..9ea914c 100644 --- a/accel-pppd/cli/tcp.c +++ b/accel-pppd/cli/tcp.c @@ -300,6 +300,8 @@ static void start_server(const char *host, int port) log_emerg("cli: tcp: failed to create server socket: %s\n", strerror(errno)); return; } + + fcntl(serv_hnd.fd, F_SETFD, fcntl(serv_hnd.fd, F_GETFD) | FD_CLOEXEC); memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; diff --git a/accel-pppd/cli/telnet.c b/accel-pppd/cli/telnet.c index 2643692..f7b4311 100644 --- a/accel-pppd/cli/telnet.c +++ b/accel-pppd/cli/telnet.c @@ -642,6 +642,8 @@ static void start_server(const char *host, int port) log_emerg("cli: telnet: failed to create server socket: %s\n", strerror(errno)); return; } + + fcntl(serv_hnd.fd, F_SETFD, fcntl(serv_hnd.fd, F_GETFD) | FD_CLOEXEC); memset(&addr, 0, sizeof(addr)); addr.sin_family = AF_INET; |