summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-07-03 15:50:31 +0200
committerLennart Poettering <lennart@poettering.net>2014-07-03 15:50:31 +0200
commit55ebf98cbecdad288ba2e3f63f7026280c62f025 (patch)
tree76db71ebb10129436002fc98483f0a34c42288e6 /src/shared
parentce4a52a500965ae6c2f95787f5346112ed56bbae (diff)
core: introduce exit_status_set_is_empty() to make things a bit easier to read
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/exit-status.c7
-rw-r--r--src/shared/exit-status.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/shared/exit-status.c b/src/shared/exit-status.c
index 942ac86128..f3434f7ccc 100644
--- a/src/shared/exit-status.c
+++ b/src/shared/exit-status.c
@@ -216,3 +216,10 @@ void exit_status_set_free(ExitStatusSet *x) {
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);
+}
diff --git a/src/shared/exit-status.h b/src/shared/exit-status.h
index 744f2d5376..7438508e4d 100644
--- a/src/shared/exit-status.h
+++ b/src/shared/exit-status.h
@@ -97,3 +97,4 @@ 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);
+bool exit_status_set_is_empty(ExitStatusSet *x);