test: stop using dup() needlessly

This commit is contained in:
Lennart Poettering
2019-04-02 12:45:46 +02:00
parent 9b4805421e
commit f71611fed2
+2 -1
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) {