various: use _NEG_ macros to reduce indentation

No functional change intended.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-08-16 12:52:56 +02:00
parent 1f2db2e315
commit bb44fd0734
23 changed files with 188 additions and 255 deletions
+5 -7
View File
@@ -792,13 +792,11 @@ static int prompt_root_password(int rfd) {
}
r = check_password_quality(*a, /* old */ NULL, "root", &error);
if (r < 0) {
if (ERRNO_IS_NOT_SUPPORTED(r))
log_warning("Password quality check is not supported, proceeding anyway.");
else
return log_error_errno(r, "Failed to check password quality: %m");
}
if (r == 0)
if (ERRNO_IS_NEG_NOT_SUPPORTED(r))
log_warning("Password quality check is not supported, proceeding anyway.");
else if (r < 0)
return log_error_errno(r, "Failed to check password quality: %m");
else if (r == 0)
log_warning("Password is weak, accepting anyway: %s", error);
r = ask_password_tty(-1, msg2, NULL, 0, 0, NULL, &b);