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 -10
View File
@@ -195,13 +195,11 @@ static int run(int argc, char *argv[]) {
continue;
r = sd_bus_process(b, &m);
if (r < 0) {
/* treat 'connection reset by peer' as clean exit condition */
if (ERRNO_IS_DISCONNECT(r))
return 0;
if (ERRNO_IS_NEG_DISCONNECT(r))
/* Treat 'connection reset by peer' as clean exit condition */
return 0;
if (r < 0)
return log_error_errno(r, "Failed to process bus: %m");
}
if (m) {
r = sd_bus_send(a, m, NULL);
@@ -241,11 +239,8 @@ static int run(int argc, char *argv[]) {
};
r = ppoll_usec(p, ELEMENTSOF(p), t);
if (r < 0) {
if (ERRNO_IS_TRANSIENT(r)) /* don't be bothered by signals, i.e. EINTR */
continue;
if (r < 0 && !ERRNO_IS_TRANSIENT(r)) /* don't be bothered by signals, i.e. EINTR */
return log_error_errno(r, "ppoll() failed: %m");
}
}
return 0;