]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/sysfs: Use dup_fd_cloexec instead of direct call to fcntl
authorGuillem Jover <guillem@hadrons.org>
Sat, 6 Jun 2015 04:19:06 +0000 (06:19 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 8 Jun 2015 10:10:03 +0000 (12:10 +0200)
Signed-off-by: Guillem Jover <guillem@hadrons.org>
lib/sysfs.c

index 07b6b56cba3a78021caac567933acab1ca5a95ab..caf89bf536e9cfec251d145c0ba826ef687d151f 100644 (file)
@@ -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;