return 0;
/* The message came from the kernel, and is sent to our legacy client. */
- sd_bus_creds_get_well_known_names(&m->creds, &sender_names);
+ (void) sd_bus_creds_get_well_known_names(&m->creds, &sender_names);
(void) sd_bus_creds_get_euid(&m->creds, &sender_uid);
(void) sd_bus_creds_get_egid(&m->creds, &sender_gid);
if (r < 0)
return handle_policy_error(m, r);
- sd_bus_creds_get_well_known_names(destination_creds, &destination_names);
+ (void) sd_bus_creds_get_well_known_names(destination_creds, &destination_names);
(void) sd_bus_creds_get_euid(destination_creds, &destination_uid);
(void) sd_bus_creds_get_egid(destination_creds, &destination_gid);
if (p->got_hello)
return 0;
- return log_error_errno(-EIO, "First packet isn't hello (it's %s.%s), aborting.", m->interface, m->member);
+ return log_error_errno(EIO, "First packet isn't hello (it's %s.%s), aborting.", m->interface, m->member);
}
if (p->got_hello)
- return log_error_errno(-EIO, "Got duplicate hello, aborting.");
+ return log_error_errno(EIO, "Got duplicate hello, aborting.");
p->got_hello = true;
assert(p);
r = sd_bus_process(p->destination_bus, &m);
+ if (r == -ECONNRESET) /* Treat 'connection reset by peer' as clean exit condition */
+ return r;
if (r < 0) {
- /* treat 'connection reset by peer' as clean exit condition */
- if (r != -ECONNRESET)
- log_error_errno(r, "Failed to process destination bus: %m");
+ log_error_errno(r, "Failed to process destination bus: %m");
return r;
}
-
if (r == 0)
return 0;
if (!m)
r = process_policy(p->destination_bus, p->local_bus, m, p->policy, &p->local_creds, p->owned_names);
if (r < 0)
return log_error_errno(r, "Failed to process policy: %m");
- else if (r > 0)
+ if (r > 0)
return 1;
}
assert(p);
r = sd_bus_process(p->local_bus, &m);
+ if (r == -ECONNRESET) /* Treat 'connection reset by peer' as clean exit condition */
+ return r;
if (r < 0) {
- /* treat 'connection reset by peer' as clean exit condition */
- if (r != -ECONNRESET)
- log_error_errno(r, "Failed to process local bus: %m");
+ log_error_errno(r, "Failed to process local bus: %m");
return r;
}
-
if (r == 0)
return 0;
if (!m)
r = process_hello(p, m);
if (r < 0)
return log_error_errno(r, "Failed to process HELLO: %m");
- else if (r > 0)
+ if (r > 0)
return 1;
r = bus_proxy_process_driver(p->destination_bus, p->local_bus, m, p->policy, &p->local_creds, p->owned_names);
if (r < 0)
return log_error_errno(r, "Failed to process driver calls: %m");
- else if (r > 0)
+ if (r > 0)
return 1;
for (;;) {
r = proxy_process_destination_to_local(p);
if (r == -ECONNRESET)
return 0;
- else if (r < 0)
+ if (r < 0)
return r;
- else if (r > 0)
+ if (r > 0)
busy = true;
}
r = proxy_process_local_to_destination(p);
if (r == -ECONNRESET)
return 0;
- else if (r < 0)
+ if (r < 0)
return r;
- else if (r > 0)
+ if (r > 0)
busy = true;
if (!busy) {