apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r219667 - /apr/apr/trunk/user/unix/userinfo.c
Date Tue, 19 Jul 2005 12:26:28 GMT
Author: pquerna
Date: Tue Jul 19 05:26:24 2005
New Revision: 219667

URL: http://svn.apache.org/viewcvs?rev=219667&view=rev
Log:
As suggested by Joe on dev@apr, don't return errno, since its not correct according to the
specs.

Modified:
    apr/apr/trunk/user/unix/userinfo.c

Modified: apr/apr/trunk/user/unix/userinfo.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/user/unix/userinfo.c?rev=219667&r1=219666&r2=219667&view=diff
==============================================================================
--- apr/apr/trunk/user/unix/userinfo.c (original)
+++ apr/apr/trunk/user/unix/userinfo.c Tue Jul 19 05:26:24 2005
@@ -114,13 +114,22 @@
 #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) && defined(HAVE_GETPWUID_R)
     struct passwd pwd;
     char pwbuf[PWBUF_SIZE];
+    apr_status_t rv;
+
+    rv = getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw);
+    if (rv) {
+        return rv;
+    }
+
+    if (pw == NULL) {
+        return APR_ENOENT;
+    }
 
-    if (getpwuid_r(userid, &pwd, pwbuf, sizeof(pwbuf), &pw) || pw == NULL) {
 #else
     if ((pw = getpwuid(userid)) == NULL) {
-#endif
         return errno;
     }
+#endif
     *username = apr_pstrdup(p, pw->pw_name);
     return APR_SUCCESS;
 }



Mime
View raw message