mirror of
https://github.com/systemd/systemd.git
synced 2025-01-06 17:18:12 +03:00
Simplify a couple of conditions
This commit is contained in:
parent
a30fdf857b
commit
516bb9c0be
@ -401,10 +401,8 @@ static int parse_credentials(void) {
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
r = read_credential_with_decryption("ssh.listen", (void*) &b, &sz);
|
r = read_credential_with_decryption("ssh.listen", (void*) &b, &sz);
|
||||||
if (r < 0)
|
if (r <= 0)
|
||||||
return r;
|
return r;
|
||||||
if (r == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
_cleanup_fclose_ FILE *f = NULL;
|
_cleanup_fclose_ FILE *f = NULL;
|
||||||
f = fmemopen_unlocked(b, sz, "r");
|
f = fmemopen_unlocked(b, sz, "r");
|
||||||
|
@ -68,7 +68,7 @@ TEST (test_dirent_is_file) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dir = opendir(t);
|
dir = opendir(t);
|
||||||
if (dir == NULL) {
|
if (!dir) {
|
||||||
log_error_errno(errno, "Failed to open directory '%s': %m", t);
|
log_error_errno(errno, "Failed to open directory '%s': %m", t);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ TEST (test_dirent_is_file_with_suffix) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dir = opendir(t);
|
dir = opendir(t);
|
||||||
if (dir == NULL) {
|
if (!dir) {
|
||||||
log_error_errno(errno, "Failed to open directory '%s': %m", t);
|
log_error_errno(errno, "Failed to open directory '%s': %m", t);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user