* ptsname_r: Fix test failure on Solaris
@ 2021-01-01 0:32 Bruno Haible
0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2021-01-01 0:32 UTC (permalink / raw)
To: bug-gnulib
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;
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-01-01 0:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-01 0:32 ptsname_r: Fix test failure on Solaris Bruno Haible
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).