summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2023-12-06 22:26:40 +0100
committerGitHub <noreply@github.com>2023-12-06 22:26:40 +0100
commit4482ea0c241019ff7b3cfd2b6cca3d01bfdda49d (patch)
treec6e1f1a8424a520251758f04fcd07ba47167a51e /src/test
parentMerge pull request #29987 from yuwata/network-bridge-vlan (diff)
parentcore/exec-invoke: prevent potential double-close of exec_fd (diff)
downloadsystemd-4482ea0c241019ff7b3cfd2b6cca3d01bfdda49d.tar.xz
systemd-4482ea0c241019ff7b3cfd2b6cca3d01bfdda49d.zip
Merge pull request #30271 from YHNdnzj/executor-cloexec
fdset,core/executor: ocloexecification ™️
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-fdset.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/test-fdset.c b/src/test/test-fdset.c
index 8947a319b6..8f00e598fd 100644
--- a/src/test/test-fdset.c
+++ b/src/test/test-fdset.c
@@ -11,8 +11,8 @@
#include "tmpfile-util.h"
TEST(fdset_new_fill) {
- int fd = -EBADF;
_cleanup_fdset_free_ FDSet *fdset = NULL;
+ int fd = -EBADF, flags;
log_close();
log_set_open_when_needed(true);
@@ -50,6 +50,9 @@ TEST(fdset_new_fill) {
assert_se(fdset_new_fill(/* filter_cloexec= */ 0, &fdset) >= 0);
assert_se(fdset_contains(fdset, fd));
+ flags = fcntl(fd, F_GETFD);
+ assert_se(flags >= 0);
+ assert_se(FLAGS_SET(flags, FD_CLOEXEC));
fdset = fdset_free(fdset);
assert_se(fcntl(fd, F_GETFD) < 0);
assert_se(errno == EBADF);