about summary refs log tree commit diff
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.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sysdeps/mach/hurd/ttyname_r.c b/sysdeps/mach/hurd/ttyname_r.c
index 35a657bf61..8fd05a8d85 100644
--- a/sysdeps/mach/hurd/ttyname_r.c
+++ b/sysdeps/mach/hurd/ttyname_r.c
@@ -41,10 +41,7 @@ __ttyname_r (int fd, char *buf, size_t buflen)
 
   len = strlen (nodename) + 1;
   if (len > buflen)
-    {
-      errno = ERANGE;
-      return errno;
-    }
+    return __hurd_fail (ERANGE), ERANGE;
 
   memcpy (buf, nodename, len);
   return 0;