From: Lennart Poettering Date: Tue, 2 Apr 2019 10:44:15 +0000 (+0200) Subject: test: stop using dup() needlessly X-Git-Tag: v242-rc1~9^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f71611fed20aa73dea6350173aa4083d477d32ab;p=thirdparty%2Fsystemd.git test: stop using dup() needlessly --- diff --git a/src/login/test-inhibit.c b/src/login/test-inhibit.c index a891b0af6fb..7f9013bf932 100644 --- a/src/login/test-inhibit.c +++ b/src/login/test-inhibit.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #include +#include #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) {