]> git.ipfire.org Git - thirdparty/systemd.git/commit
test-fd-util: compare FDs to /bin/sh instead of /dev/null 35556/head
authorLuca Boccassi <luca.boccassi@gmail.com>
Wed, 11 Dec 2024 13:40:10 +0000 (13:40 +0000)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 11 Dec 2024 13:42:11 +0000 (13:42 +0000)
commit3b32d333e88f2a66651d58e32e01599fa84c3d19
tree3624f60e7eb111193a0b3f7680460136e88fe8d1
parent630a2e7ee195ca96e102acac8df67a278a879124
test-fd-util: compare FDs to /bin/sh instead of /dev/null

/dev/null is a character device, so same_fd() in the fallback path
that compares fstat will fail, as that bails out if the fd refers
to a char device. This happens on kernels without F_DUPFD_QUERY and
without kcmp.

/* test_same_fd */
Assertion 'same_fd(d, e) > 0' failed at src/test/test-fd-util.c:111, function test_same_fd(). Aborting.

Fixes #35552
src/test/test-fd-util.c