summaryrefslogtreecommitdiff
path: root/src/shared/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/util.c')
-rw-r--r--src/shared/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 57943b6411..5827f6c7a1 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -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;