From 96e1b38586e80a0f014038bf4fdf4689c668fbd6 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 30 Sep 2007 23:50:48 +0000 Subject: introduce and use close_on_exec_on(fd). -50 bytes. --- miscutils/devfsd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'miscutils/devfsd.c') diff --git a/miscutils/devfsd.c b/miscutils/devfsd.c index bfa5c1727..734d4a7d9 100644 --- a/miscutils/devfsd.c +++ b/miscutils/devfsd.c @@ -371,10 +371,7 @@ int devfsd_main(int argc, char **argv) xchdir(mount_point); fd = xopen(".devfsd", O_RDONLY); - - if (fcntl(fd, F_SETFD, FD_CLOEXEC) != 0) - bb_perror_msg_and_die("FD_CLOEXEC"); - + close_on_exec_on(fd); xioctl(fd, DEVFSDIOC_GET_PROTO_REV, &proto_rev); /*setup initial entries */ -- cgit v1.2.3