1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-26 14:04:03 +03:00

test: stop using dup() needlessly

This commit is contained in:
Lennart Poettering 2019-04-02 12:44:15 +02:00
parent 9b4805421e
commit f71611fed2

View File

@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#include <unistd.h>
#include <fcntl.h>
#include "sd-bus.h"
@ -30,7 +31,7 @@ static int inhibit(sd_bus *bus, const char *what) {
assert_se(r >= 0);
assert_se(fd >= 0);
return dup(fd);
return fcntl(fd, F_DUPFD_CLOEXEC, 3);
}
static void print_inhibitors(sd_bus *bus) {