}
r = sd_event_source_set_enabled(s, SD_EVENT_ONESHOT);
- if (r < 0) {
- log_error_errno(r, "Error while re-enabling listener with ONESHOT: %m");
- sd_event_exit(context->event, r);
- return r;
- }
+ if (r < 0)
+ return log_error_errno(r, "Error while re-enabling listener with ONESHOT: %m");
return 1;
}
r = set_ensure_put(&context->listen, NULL, source);
if (r < 0) {
- log_error_errno(r, "Failed to add source to set: %m");
sd_event_source_unref(source);
- return r;
+ return log_error_errno(r, "Failed to add source to set: %m");
}
+ r = sd_event_source_set_exit_on_failure(source, true);
+ if (r < 0)
+ return log_error_errno(r, "Failed to enable exit-on-failure logic: %m");
+
/* Set the watcher to oneshot in case other processes are also
* watching to accept(). */
r = sd_event_source_set_enabled(source, SD_EVENT_ONESHOT);