chiark / gitweb /
errno is positive
[elogind.git] / src / shared / util.c
index 57943b64117f9afa5ac99f13599d46254e45f26b..5827f6c7a14dfa3afbebc0e0befd601d5f6ca277 100644 (file)
@@ -5259,7 +5259,7 @@ int get_home_dir(char **_h) {
         errno = 0;
         p = getpwuid(u);
         if (!p)
-                return errno ? -errno : -ESRCH;
+                return errno > 0 ? -errno : -ESRCH;
 
         if (!path_is_absolute(p->pw_dir))
                 return -EINVAL;