lib/sysfs: Use dup_fd_cloexec instead of direct call to fcntl
Signed-off-by: Guillem Jover <guillem@hadrons.org>
This commit is contained in:
parent
8e86d93d1e
commit
fef6f84a15
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue