From: Mark Brown Date: Fri, 27 Feb 2026 15:20:35 +0000 (+0000) Subject: selftests/filesystems: Assume that TIOCGPTPEER is defined X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f7df26875b9a07d756a5f4cac26dac95bf1d9de1;p=thirdparty%2Fkernel%2Flinux.git selftests/filesystems: Assume that TIOCGPTPEER is defined The devpts_pts selftest has an ifdef in case an architecture does not define TIOCGPTPEER, but the handling for this is broken since we need errno to be set to EINVAL in order to skip the test as we should. Given that this ioctl() has been defined since v4.15 we may as well just assume it's there rather than write handling code which will probably never get used. Signed-off-by: Mark Brown Link: https://patch.msgid.link/20260227-selftests-filesystems-devpts-tiocgptpeer-v3-1-07db4d85d5aa@kernel.org Signed-off-by: Christian Brauner --- diff --git a/tools/testing/selftests/filesystems/devpts_pts.c b/tools/testing/selftests/filesystems/devpts_pts.c index 54fea349204e4..aa8d5324f2a6c 100644 --- a/tools/testing/selftests/filesystems/devpts_pts.c +++ b/tools/testing/selftests/filesystems/devpts_pts.c @@ -119,9 +119,7 @@ static int do_tiocgptpeer(char *ptmx, char *expected_procfd_contents) goto do_cleanup; } -#ifdef TIOCGPTPEER slave = ioctl(master, TIOCGPTPEER, O_RDWR | O_NOCTTY | O_CLOEXEC); -#endif if (slave < 0) { if (errno == EINVAL) { fprintf(stderr, "TIOCGPTPEER is not supported. "