diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-04-30 23:08:55 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-05-07 12:11:42 +0200 |
commit | dd8454c17694e6857447f0dd8fb3ff4b409b3bdc (patch) | |
tree | 2386a971a58cdd2109e0778545802f797531efe2 | |
parent | 31844743c6b1333317c154e017d7121c5d689f8f (diff) | |
download | systemd-dd8454c17694e6857447f0dd8fb3ff4b409b3bdc.tar.gz |
userdb: remove unnecesary repeated if check
(cherry picked from commit 77fe7d15931cc17c933ae8778c4161112783dc79)
-rw-r--r-- | src/shared/userdb.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/shared/userdb.c b/src/shared/userdb.c index e188123e2e..149a8e1a0e 100644 --- a/src/shared/userdb.c +++ b/src/shared/userdb.c @@ -776,11 +776,11 @@ int userdb_iterator_get(UserDBIterator *iterator, UserRecord **ret) { iterator->n_found++; return synthetic_nobody_user_build(ret); } - } - /* if we found at least one entry, then ignore errors and indicate that we reached the end */ - if (r < 0 && iterator->n_found > 0) - return -ESRCH; + /* if we found at least one entry, then ignore errors and indicate that we reached the end */ + if (iterator->n_found > 0) + return -ESRCH; + } return r; } @@ -975,11 +975,11 @@ int groupdb_iterator_get(UserDBIterator *iterator, GroupRecord **ret) { iterator->n_found++; return synthetic_nobody_group_build(ret); } - } - /* if we found at least one entry, then ignore errors and indicate that we reached the end */ - if (r < 0 && iterator->n_found > 0) - return -ESRCH; + /* if we found at least one entry, then ignore errors and indicate that we reached the end */ + if (iterator->n_found > 0) + return -ESRCH; + } return r; } |