diff options
author | Petr Vorel <pvorel@suse.cz> | 2024-01-24 15:19:27 +0100 |
---|---|---|
committer | Petr Vorel <petr.vorel@gmail.com> | 2024-01-24 17:53:55 +0100 |
commit | cc0f84832204b99b2bd4db2bf236e8a1f6f39af2 (patch) | |
tree | 972dec2f288eb3a96339f94c858755de6ebc5411 | |
parent | a2b94577685cff6188e3057821b55eaa6e43ba29 (diff) | |
download | ltp-cc0f84832204b99b2bd4db2bf236e8a1f6f39af2.tar.gz |
lib: tst_fd: Use tst_res(TCONF)
to avoid error on older distro (kernel 4.12)
tst_fd.c:144: TBROK: pidfd_open(): ENOSYS (38)
We need tst_res() so that tst_fd_next() iterator continues with next
file descriptor and TCONF.
Fixes: a2b945776 ("lib: tst_fd: Avoid tst_brk(TCONF, ...) on older distros")
Suggested-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
Reviewed-by: Martin Doucha <mdoucha@suse.cz>
Signed-off-by: Petr Vorel <pvorel@suse.cz>
-rw-r--r-- | lib/tst_fd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/tst_fd.c b/lib/tst_fd.c index ab7de81aa..b3d43a7c3 100644 --- a/lib/tst_fd.c +++ b/lib/tst_fd.c @@ -103,7 +103,7 @@ static void open_epoll(struct tst_fd *fd) fd->fd = epoll_create(1); if (fd->fd < 0) - tst_brk(TBROK | TERRNO, "epoll_create()"); + tst_res(TCONF | TERRNO, "epoll_create()"); } static void open_eventfd(struct tst_fd *fd) @@ -141,7 +141,7 @@ static void open_pidfd(struct tst_fd *fd) { fd->fd = syscall(__NR_pidfd_open, getpid(), 0); if (fd->fd < 0) - tst_brk(TBROK | TERRNO, "pidfd_open()"); + tst_res(TCONF | TERRNO, "pidfd_open()"); } static void open_fanotify(struct tst_fd *fd) |