Let's use the macro we already have to make this safer. Moreover log
about all other errors.
#include "build.h"
#include "bus-internal.h"
#include "bus-util.h"
+#include "errno-util.h"
#include "log.h"
#include "main-func.h"
#include "util.h"
continue;
r = sd_bus_process(b, &m);
- if (r < 0)
+ if (r < 0) {
/* treat 'connection reset by peer' as clean exit condition */
- return r == -ECONNRESET ? 0 : r;
+ if (ERRNO_IS_DISCONNECT(r))
+ return 0;
+
+ return log_error_errno(r, "Failed to process bus: %m");
+ }
if (m) {
r = sd_bus_send(a, m, NULL);