event: rework sd-event exit logic

With this change a failing event source handler will not cause the
entire event loop to fail. Instead, we just disable the specific event
source, log a message at debug level and go on.

This also introduces a new concept of "exit code" which can be stored in
the event loop and is returned by sd_event_loop(). We also rename "quit"
to "exit" everywhere else.

Altogether this should make things more robus and keep errors local
while still providing a way to return event loop errors in a clear way.
This commit is contained in:
Lennart Poettering
2013-12-13 04:06:43 +01:00
parent 6e41a3e53d
commit 6203e07a83
14 changed files with 93 additions and 80 deletions
-2
View File
@@ -645,8 +645,6 @@ int main(int argc, char *argv[]) {
goto finish;
}
r = 0;
finish:
context_free(&context, bus);