mirror of
https://github.com/systemd/systemd.git
synced 2026-08-04 15:10:33 +00:00
replace more dup() by F_DUPFD_CLOEXEC
This commit is contained in:
@@ -64,7 +64,7 @@ static int inhibit(sd_bus *bus, sd_bus_error *error) {
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
r = dup(fd);
|
||||
r = fcntl(fd, F_DUPFD_CLOEXEC, 3);
|
||||
if (r < 0)
|
||||
return -errno;
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ static int remove_marked_symlinks(
|
||||
int q, cfd;
|
||||
deleted = false;
|
||||
|
||||
cfd = dup(fd);
|
||||
cfd = fcntl(fd, F_DUPFD_CLOEXEC, 3);
|
||||
if (cfd < 0) {
|
||||
r = -errno;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user