Linux: unlockpt needs to fail with EINVAL, not ENOTTY (bug 26053)
authorFlorian Weimer <fweimer@redhat.com>
Wed, 7 Oct 2020 08:48:10 +0000 (10:48 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 7 Oct 2020 08:56:00 +0000 (10:56 +0200)
commit0f9793a556675d67d7c1897553f92e7152d1e598
tree4f938bc2e03c843f8651a7b3afb0022fdd268ced
parentc42b7058a2f8dea5c0b95e64aa82ee1d62a2ba14
Linux: unlockpt needs to fail with EINVAL, not ENOTTY (bug 26053)

The EINVAL error code is mandated by POSIX and documented in the
manual.  Also clean up the unlockpt implementation a bit, assuming
that TIOCSPTLCK is always defined.

Enhance login/tst-grantpt to cover unlockpt corner cases.

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
login/tst-grantpt.c
sysdeps/unix/sysv/linux/unlockpt.c