diff options
author | Ted Lemon <source@isc.org> | 2000-01-05 18:10:59 +0000 |
---|---|---|
committer | Ted Lemon <source@isc.org> | 2000-01-05 18:10:59 +0000 |
commit | 892aa61aa4b9168e4367ac407ff4666745f0335c (patch) | |
tree | 62ddef68217077cc3b80504d775c6fc8944621c8 /omapip | |
parent | 9a83b1d954e9bdd0a68527a854980d531fba5086 (diff) | |
download | isc-dhcp-892aa61aa4b9168e4367ac407ff4666745f0335c.tar.gz |
Use close-on-exec if available.
Diffstat (limited to 'omapip')
-rw-r--r-- | omapip/connection.c | 9 | ||||
-rw-r--r-- | omapip/listener.c | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/omapip/connection.c b/omapip/connection.c index 78a70018..41ca2bf7 100644 --- a/omapip/connection.c +++ b/omapip/connection.c @@ -93,6 +93,15 @@ isc_result_t omapi_connect (omapi_object_t *c, return ISC_R_UNEXPECTED; } +#if defined (HAVE_SETFD) + if (fcntl (obj -> socket, F_SETFD, 1) < 0) { + close (obj -> socket); + omapi_object_dereference ((omapi_object_t **)&obj, + "omapi_connect"); + return ISC_R_UNEXPECTED; + } +#endif + /* Set the SO_REUSEADDR flag (this should not fail). */ flag = 1; if (setsockopt (obj -> socket, SOL_SOCKET, SO_REUSEADDR, diff --git a/omapip/listener.c b/omapip/listener.c index cdb54a58..dba434a6 100644 --- a/omapip/listener.c +++ b/omapip/listener.c @@ -69,6 +69,15 @@ isc_result_t omapi_listen (omapi_object_t *h, return ISC_R_UNEXPECTED; } +#if defined (HAVE_SETFD) + if (fcntl (obj -> socket, F_SETFD, 1) < 0) { + close (obj -> socket); + omapi_object_dereference ((omapi_object_t **)&obj, + "omapi_listen"); + return ISC_R_UNEXPECTED; + } +#endif + /* Try to bind to the wildcard address using the port number we were given. */ if (bind (obj -> socket, |