[Glibc-bsd-commits] r5163 - trunk/glibc-ports/kfreebsd

rmh at alioth.debian.org rmh at alioth.debian.org
Thu Nov 28 15:27:58 UTC 2013


Author: rmh
Date: 2013-11-24 11:23:30 +0000 (Ne, 24 lis 2013)
New Revision: 5163

Modified:
   trunk/glibc-ports/kfreebsd/getlogin_r.c
Log:
Return errno on getlogin_r() failure, as per POSIX

Modified: trunk/glibc-ports/kfreebsd/getlogin_r.c
===================================================================
--- trunk/glibc-ports/kfreebsd/getlogin_r.c	2013-11-23 20:59:15 UTC (rev 5162)
+++ trunk/glibc-ports/kfreebsd/getlogin_r.c	2013-11-24 11:23:30 UTC (rev 5163)
@@ -48,7 +48,7 @@
   if (__getlogin_cache == NULL)
     {
       if (INLINE_SYSCALL (getlogin, 2, __getlogin_cache_room, MAXLOGNAME) < 0)
-	return -1;
+	return errno;
       /* The system call should return a NULL terminated name.  */
       if (__memchr (__getlogin_cache_room, '\0', MAXLOGNAME) == NULL)
 	abort ();
@@ -64,7 +64,7 @@
   else
     {
       __set_errno (ERANGE);
-      return -1;
+      return ERANGE;
     }
 }
 libc_hidden_def (getlogin_r)




More information about the Glibc-bsd-commits mailing list