unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [hurd,commited] hurd: fix ptsname error when called on a non-tty
@ 2020-05-28 10:38 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2020-05-28 10:38 UTC (permalink / raw)
  To: libc-alpha; +Cc: commit-hurd

* sysdeps/mach/hurd/ptsname.c (__ptsname_internal): Replace
not-supported errors from __term_get_peername with ENOTTY.
---
 sysdeps/mach/hurd/ptsname.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sysdeps/mach/hurd/ptsname.c b/sysdeps/mach/hurd/ptsname.c
index 87fac8fc28..9627f970f9 100644
--- a/sysdeps/mach/hurd/ptsname.c
+++ b/sysdeps/mach/hurd/ptsname.c
@@ -48,7 +48,11 @@ __ptsname_internal (int fd, char *buf, size_t buflen, struct stat64 *stp)
   error_t err;
 
   if (err = HURD_DPORT_USE (fd, __term_get_peername (port, peername)))
-    return __hurd_dfail (fd, err), errno;
+    {
+      if (err == EMIG_BAD_ID || err == EOPNOTSUPP)
+	err = ENOTTY;
+      return __hurd_dfail (fd, err), errno;
+    }
 
   len = __strnlen (peername, sizeof peername - 1) + 1;
   if (len > buflen)
-- 
2.26.2


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-28 10:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 10:38 [hurd,commited] hurd: fix ptsname error when called on a non-tty Samuel Thibault

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).