bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: ptsname_r: Fix test failure on Solaris
Date: Fri, 01 Jan 2021 01:32:52 +0100	[thread overview]
Message-ID: <2902930.uBPCLKOMD8@omega> (raw)

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;



                 reply	other threads:[~2021-01-01  0:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2902930.uBPCLKOMD8@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).