aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/ttyname_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/ttyname_r.c')
-rw-r--r--sysdeps/mach/hurd/ttyname_r.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sysdeps/mach/hurd/ttyname_r.c b/sysdeps/mach/hurd/ttyname_r.c
index 8896252..5f6c9c3 100644
--- a/sysdeps/mach/hurd/ttyname_r.c
+++ b/sysdeps/mach/hurd/ttyname_r.c
@@ -34,7 +34,11 @@ __ttyname_r (int fd, char *buf, size_t buflen)
nodename[0] = '\0';
if (err = HURD_DPORT_USE (fd, __term_get_nodename (port, nodename)))
- return __hurd_dfail (fd, err), errno;
+ {
+ if (err == MIG_BAD_ID || err == EOPNOTSUPP)
+ err = ENOTTY;
+ return __hurd_dfail (fd, err), errno;
+ }
len = strlen (nodename) + 1;
if (len > buflen)