X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Fexit-status.c;h=5c73b4d3c0d1384c27e6edf748d8fa2cf162d357;hp=0a1034d8e2508c0c311fd210df50962aa40b1494;hb=592fd144ae313855f48d0ca52a103013b41e5d59;hpb=3900e5fdff688dc3c273f177d9d913b7389d5561 diff --git a/src/shared/exit-status.c b/src/shared/exit-status.c index 0a1034d8e..5c73b4d3c 100644 --- a/src/shared/exit-status.c +++ b/src/shared/exit-status.c @@ -145,6 +145,12 @@ const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level) { case EXIT_CHOWN: return "CHOWN"; + + case EXIT_MAKE_STARTER: + return "MAKE_STARTER"; + + case EXIT_BUS_ENDPOINT: + return "BUS_ENDPOINT"; } } @@ -180,7 +186,7 @@ bool is_clean_exit(int code, int status, ExitStatusSet *success_status) { if (code == CLD_EXITED) return status == 0 || (success_status && - set_contains(success_status->code, INT_TO_PTR(status))); + set_contains(success_status->status, INT_TO_PTR(status))); /* If a daemon does not implement handlers for some of the * signals that's not considered an unclean shutdown */ @@ -205,3 +211,18 @@ bool is_clean_exit_lsb(int code, int status, ExitStatusSet *success_status) { code == CLD_EXITED && (status == EXIT_NOTINSTALLED || status == EXIT_NOTCONFIGURED); } + +void exit_status_set_free(ExitStatusSet *x) { + assert(x); + + set_free(x->status); + set_free(x->signal); + x->status = x->signal = NULL; +} + +bool exit_status_set_is_empty(ExitStatusSet *x) { + if (!x) + return true; + + return set_isempty(x->status) && set_isempty(x->signal); +}