[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
ptsname_r: Fix test failure on Solaris
From: |
Bruno Haible |
Subject: |
ptsname_r: Fix test failure on Solaris |
Date: |
Fri, 01 Jan 2021 01:32:52 +0100 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-197-generic; KDE/5.18.0; x86_64; ; ) |
The ptsname_r test fails on Solaris 11 OpenIndiana and Solaris 11 OmniOS:
../../gltests/test-ptsname_r.c:167: assertion 'result == 0' failed
FAIL test-ptsname_r (exit status: 262)
This patch fixes it, by removing the test on the major number of the
device. This major number is (according to 'ls -l /dev/pts/'):
- 24 on Solaris 10,
- 221 on Solaris 11.3,
- 195 on Solaris OpenIndiana,
- 180 on Solaris OmniOS.
2020-12-31 Bruno Haible <bruno@clisp.org>
ptsname_r: Fix test failure on Solaris.
* lib/ptsname_r.c (__ptsname_r) [__sun]: Don't test the major number of
the device.
diff --git a/lib/ptsname_r.c b/lib/ptsname_r.c
index 0008b95..c2fc65f 100644
--- a/lib/ptsname_r.c
+++ b/lib/ptsname_r.c
@@ -97,7 +97,7 @@ __ptsname_r (int fd, char *buf, size_t buflen)
# if defined __sun /* Solaris */
if (fstat (fd, &st) < 0)
return errno;
- if (!(S_ISCHR (st.st_mode) && major (st.st_rdev) == 0))
+ if (!S_ISCHR (st.st_mode))
{
errno = ENOTTY;
return errno;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- ptsname_r: Fix test failure on Solaris,
Bruno Haible <=