about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/getlogin_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/getlogin_r.c')
-rw-r--r--sysdeps/mach/hurd/getlogin_r.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sysdeps/mach/hurd/getlogin_r.c b/sysdeps/mach/hurd/getlogin_r.c
index 2e43225182..c1a2f14e5e 100644
--- a/sysdeps/mach/hurd/getlogin_r.c
+++ b/sysdeps/mach/hurd/getlogin_r.c
@@ -31,14 +31,11 @@ __getlogin_r (char *name, size_t name_len)
   error_t err;
 
   if (err = __USEPORT (PROC, __proc_getlogin (port, login)))
-    return errno = err;
+    return __hurd_fail (err), err;
 
   size_t len = __strnlen (login, sizeof login - 1) + 1;
   if (len > name_len)
-    {
-      errno = ERANGE;
-      return errno;
-    }
+    return __hurd_fail (ERANGE), ERANGE;
 
   memcpy (name, login, len);
   return 0;