aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-09-30 23:50:48 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2007-09-30 23:50:48 +0000
commit96e1b38586e80a0f014038bf4fdf4689c668fbd6 (patch)
treed7f6a7866700601598cfcc006b7dcb6cb4a7c07e /libbb
parentdeabacdf91c6d1c3cfcdb4cd06780807193de81d (diff)
downloadbusybox-96e1b38586e80a0f014038bf4fdf4689c668fbd6.tar.gz
busybox-96e1b38586e80a0f014038bf4fdf4689c668fbd6.tar.bz2
introduce and use close_on_exec_on(fd). -50 bytes.
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xfuncs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libbb/xfuncs.c b/libbb/xfuncs.c
index eb1633be2..2bf20f3a0 100644
--- a/libbb/xfuncs.c
+++ b/libbb/xfuncs.c
@@ -164,6 +164,11 @@ int ndelay_on(int fd)
return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) | O_NONBLOCK);
}
+int close_on_exec_on(int fd)
+{
+ return fcntl(fd, F_SETFD, FD_CLOEXEC);
+}
+
int ndelay_off(int fd)
{
return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) & ~O_NONBLOCK);