I think if we log the error as being _ignored_, we should also consider
the event as handled and clear it. This was the behaviour prior to
575b300b (PR #7968).
I don't think we particularly wanted to change behaviour and keep retrying.
Sometimes that's useful, other times you cause more problems by filling the
logs.
Plus a nearby typo fix.
if (waitid(P_ALL, 0, &si, WEXITED|WNOHANG|WNOWAIT) < 0) {
- if (errno == ECHILD)
- goto turn_off;
+ if (errno != ECHILD)
+ log_error_errno(errno, "Failed to peek for child with waitid(), ignoring: %m");
- log_error_errno(errno, "Failed to peek for child with waitid(), ignoring: %m");
- return 0;
+ goto turn_off;
}
if (si.si_pid <= 0)
case SIGCHLD:
r = sd_event_source_set_enabled(m->sigchld_event_source, SD_EVENT_ON);
if (r < 0)
- log_warning_errno(r, "Failed to enable SIGCHLD even source, ignoring: %m");
+ log_warning_errno(r, "Failed to enable SIGCHLD event source, ignoring: %m");
break;