From: Luca Boccassi Date: Wed, 11 Dec 2024 18:31:08 +0000 (+0000) Subject: test-fd-util: compare FDs to /bin/sh instead of /dev/null X-Git-Tag: archive/raspbian/257.5-2+rpi1^2^2^2^2^2^2^2^2^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fc7d1ac2ab7d1be51eb7a9c270eed23324162e8e;p=systemd.git test-fd-util: compare FDs to /bin/sh instead of /dev/null Origin: upstream, commit:3b32d333e88f2a66651d58e32e01599fa84c3d19) Forwarded: yes Gbp-Pq: Name test-fd-util-compare-FDs-to-bin-sh-instead-of-dev-null.patch --- diff --git a/src/test/test-fd-util.c b/src/test/test-fd-util.c index 5817d927..a359efa0 100644 --- a/src/test/test-fd-util.c +++ b/src/test/test-fd-util.c @@ -76,9 +76,9 @@ TEST(same_fd) { assert_se(pipe2(p, O_CLOEXEC) >= 0); assert_se((a = fcntl(p[0], F_DUPFD, 3)) >= 0); - assert_se((b = open("/dev/null", O_RDONLY|O_CLOEXEC)) >= 0); + assert_se((b = open("/bin/sh", O_RDONLY|O_CLOEXEC)) >= 0); assert_se((c = fcntl(a, F_DUPFD, 3)) >= 0); - assert_se((d = open("/dev/null", O_RDONLY|O_CLOEXEC|O_PATH)) >= 0); /* O_PATH changes error returns in F_DUPFD_QUERY, let's test explicitly */ + assert_se((d = open("/bin/sh", O_RDONLY|O_CLOEXEC|O_PATH)) >= 0); /* O_PATH changes error returns in F_DUPFD_QUERY, let's test explicitly */ assert_se((e = fcntl(d, F_DUPFD, 3)) >= 0); assert_se(same_fd(p[0], p[0]) > 0);