From: Guillem Jover Date: Sat, 6 Jun 2015 04:19:06 +0000 (+0200) Subject: lib/sysfs: Use dup_fd_cloexec instead of direct call to fcntl X-Git-Tag: v2.27-rc1~163 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fef6f84a15aaf5898b4ccfb8ecc145201747cae1;p=thirdparty%2Futil-linux.git lib/sysfs: Use dup_fd_cloexec instead of direct call to fcntl Signed-off-by: Guillem Jover --- diff --git a/lib/sysfs.c b/lib/sysfs.c index 07b6b56cba..caf89bf536 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -267,7 +267,7 @@ DIR *sysfs_opendir(struct sysfs_cxt *cxt, const char *attr) * -- we cannot use cxt->sysfs_fd directly, because closedir() * will close this our persistent file descriptor. */ - fd = fcntl(cxt->dir_fd, F_DUPFD_CLOEXEC, STDERR_FILENO + 1); + fd = dup_fd_cloexec(cxt->dir_fd, STDERR_FILENO + 1); if (fd < 0) return NULL;