From 3f1d795758f2a2099175e321ea2e025cb6a29e43 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 19 Aug 2013 10:21:23 -0400 Subject: [PATCH] roken: introduce rk_cloexec_socket Accepts type rk_socket_t and is a no-op on Windows Change-Id: I82755872e86ef36445e60054dd752279aaceb6d1 --- lib/roken/cloexec.c | 9 +++++++++ lib/roken/roken-common.h | 3 +++ lib/roken/version-script.map | 1 + 3 files changed, 13 insertions(+) diff --git a/lib/roken/cloexec.c b/lib/roken/cloexec.c index 2d1fe033f..59ffa50ae 100644 --- a/lib/roken/cloexec.c +++ b/lib/roken/cloexec.c @@ -64,3 +64,12 @@ rk_cloexec_dir(DIR * d) rk_cloexec(dirfd(d)); #endif } + +void ROKEN_LIB_FUNCTION +rk_cloexec_socket(rk_socket_t s) +{ +#ifndef _WIN32 + rk_cloexec((int)s); +#endif +} + diff --git a/lib/roken/roken-common.h b/lib/roken/roken-common.h index 451a01082..443299590 100644 --- a/lib/roken/roken-common.h +++ b/lib/roken/roken-common.h @@ -499,6 +499,9 @@ rk_cloexec_file(FILE *); ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL rk_cloexec_dir(DIR *); +ROKEN_LIB_FUNCTION void ROKEN_LIB_CALL +rk_cloexec_socket(rk_socket_t *); + ROKEN_LIB_FUNCTION int ROKEN_LIB_CALL ct_memcmp(const void *, const void *, size_t); diff --git a/lib/roken/version-script.map b/lib/roken/version-script.map index 7fbb7f877..1fb4d8d37 100644 --- a/lib/roken/version-script.map +++ b/lib/roken/version-script.map @@ -43,6 +43,7 @@ HEIMDAL_ROKEN_1.0 { rk_cloexec; rk_cloexec_file; rk_cloexec_dir; + rk_cloexec_socket; rk_closefrom; rk_copyhostent; rk_dns_free_data;