]> Savannah Git Hosting - gnulib.git/commitdiff
ptsname_r: Fix test failure on Solaris.
authorBruno Haible <bruno@clisp.org>
Fri, 1 Jan 2021 00:12:08 +0000 (01:12 +0100)
committerBruno Haible <bruno@clisp.org>
Fri, 1 Jan 2021 00:12:08 +0000 (01:12 +0100)
* lib/ptsname_r.c (__ptsname_r) [__sun]: Don't test the major number of
the device.

ChangeLog
lib/ptsname_r.c

index bc807d0afba36614539134a1e8b03d46bfb0fcbe..9cb45d0d7e5ce605ac0e1eb1ee1472ba6fc820b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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.
+
 2020-12-31  Bruno Haible  <bruno@clisp.org>
 
        posixtm tests: Disable part of the test on plaforms where it fails.
index 0008b95304d1d4d1ba0d795ac6af35d5bc8ab3ee..c2fc65f4bc5dd7e0cab7f79d0247ca476ffb863b 100644 (file)
@@ -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;