]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/filesystems: Assume that TIOCGPTPEER is defined
authorMark Brown <broonie@kernel.org>
Fri, 27 Feb 2026 15:20:35 +0000 (15:20 +0000)
committerChristian Brauner <brauner@kernel.org>
Mon, 2 Mar 2026 10:08:20 +0000 (11:08 +0100)
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 <broonie@kernel.org>
Link: https://patch.msgid.link/20260227-selftests-filesystems-devpts-tiocgptpeer-v3-1-07db4d85d5aa@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
tools/testing/selftests/filesystems/devpts_pts.c

index 54fea349204e4cdb0593fc4a5d4e0ca38680f53e..aa8d5324f2a6c81559f9db47c0c44dde1c145163 100644 (file)
@@ -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. "