summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-03 12:47:40 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-03 12:51:07 +0200
commit37520c1bec9a92adbe02fceaece588a7aa2fea2b (patch)
treefce49d94c6c67e2563f86b509c4d07b582a35849 /src/shared
parentffd488e272aa95f7d43626e1f90fea8c30a5863b (diff)
core: introduce new RestartForceExitStatus= service setting
This does the inverse of RestartPreventExitStatus=: it forces a restart of a service when a certain exit status is returned by a service process.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/exit-status.c8
-rw-r--r--src/shared/exit-status.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/src/shared/exit-status.c b/src/shared/exit-status.c
index ce1f1bde65..38d71e182d 100644
--- a/src/shared/exit-status.c
+++ b/src/shared/exit-status.c
@@ -208,3 +208,11 @@ 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->code);
+ set_free(x->signal);
+ x->code = x->signal = NULL;
+}
diff --git a/src/shared/exit-status.h b/src/shared/exit-status.h
index 57d066f155..93abf7f10e 100644
--- a/src/shared/exit-status.h
+++ b/src/shared/exit-status.h
@@ -95,3 +95,5 @@ const char* exit_status_to_string(ExitStatus status, ExitStatusLevel level) _con
bool is_clean_exit(int code, int status, ExitStatusSet *success_status);
bool is_clean_exit_lsb(int code, int status, ExitStatusSet *success_status);
+
+void exit_status_set_free(ExitStatusSet *x);