userdb: remove unnecesary repeated if check

This commit is contained in:
Lennart Poettering
2021-05-06 18:36:32 +02:00
parent 27a5a22f03
commit 77fe7d1593
+8 -8
View File
@@ -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;
}