about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/ttyname.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/ttyname.c')
-rw-r--r--sysdeps/mach/hurd/ttyname.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/ttyname.c b/sysdeps/mach/hurd/ttyname.c
index 927851e2e1..6e2e5bf675 100644
--- a/sysdeps/mach/hurd/ttyname.c
+++ b/sysdeps/mach/hurd/ttyname.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1994, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1994, 1997, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -32,7 +32,11 @@ ttyname (int fd)
 
   nodename[0] = '\0';
   if (err = HURD_DPORT_USE (fd, __term_get_nodename (port, nodename)))
-    return __hurd_dfail (fd, err), NULL;
+    {
+      if (err == MIG_BAD_ID || err == EOPNOTSUPP)
+	err = ENOTTY;
+      return __hurd_dfail (fd, err), NULL;
+    }
 
   return nodename;
 }