summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/find_uid.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/util/find_uid.c b/src/util/find_uid.c
index d9b911b8..6d1478e7 100644
--- a/src/util/find_uid.c
+++ b/src/util/find_uid.c
@@ -310,15 +310,15 @@ errno_t check_if_uid_is_active(uid_t uid, bool *result)
ret = sd_uid_get_sessions(uid, 0, NULL);
if (ret > 0) {
*result = true;
+ return EOK;
}
if (ret == 0) {
*result = false;
}
- if (ret >= 0) {
- return EOK;
+ if (ret < 0) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("systemd-login gave error %d: %s\n",
+ -ret, strerror(-ret)));
}
- DEBUG(SSSDBG_CRIT_FAILURE, ("systemd-login gave error %d: %s\n",
- -ret, strerror(-ret)));
/* fall back to the old method */
#endif