When sd_event_prepare returns an error there is currently
no way to restore the event loop working.
It happens when a callback of an sd_event is faulty
(ex: SIGSEGV). In that case the monitoring of signals
(sig-monitor) interfer badly with systemd. But at the
the application firstly has error.
To avoid flooding the journal with messages, aborting
is the best solution.
Bug-AGL: SPEC-1681
Change-Id: If01295f07b3c3fc8c8ec1ac5bf04840d42ee9774
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
rc = sd_event_prepare(se);
if (rc < 0) {
errno = -rc;
- ERROR("sd_event_prepare returned an error (state: %d): %m", sd_event_get_state(se));
+ CRITICAL("sd_event_prepare returned an error (state: %d): %m", sd_event_get_state(se));
+ abort();
} else {
if (rc == 0) {
rc = sd_event_wait(se, (uint64_t)(int64_t)-1);