summaryrefslogtreecommitdiff
path: root/omapip/connection.c
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2000-01-05 18:10:59 +0000
committerTed Lemon <source@isc.org>2000-01-05 18:10:59 +0000
commit892aa61aa4b9168e4367ac407ff4666745f0335c (patch)
tree62ddef68217077cc3b80504d775c6fc8944621c8 /omapip/connection.c
parent9a83b1d954e9bdd0a68527a854980d531fba5086 (diff)
downloadisc-dhcp-892aa61aa4b9168e4367ac407ff4666745f0335c.tar.gz
Use close-on-exec if available.
Diffstat (limited to 'omapip/connection.c')
-rw-r--r--omapip/connection.c9
1 files changed, 9 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,