summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-19 03:18:49 +0200
committerLennart Poettering <lennart@poettering.net>2010-08-20 02:31:54 +0200
commitd06dacd0020af7e31ff6089deff339b00ed979e3 (patch)
tree40d3db2c57f53955645e95df805b43913c6e3dde /src/util.c
parent8a2b3c097b5ebd53348700f591e50530a82b5cea (diff)
service/systemctl: don't consider LSB exit codes 5 and 6 as failure, and decode exit codes in systemctl
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 0b0063ee0e..7903ca07b9 100644
--- a/src/util.c
+++ b/src/util.c
@@ -57,6 +57,7 @@
#include "log.h"
#include "strv.h"
#include "label.h"
+#include "exit-status.h"
bool streq_ptr(const char *a, const char *b) {
@@ -2398,6 +2399,16 @@ bool is_clean_exit(int code, int status) {
return false;
}
+bool is_clean_exit_lsb(int code, int status) {
+
+ if (is_clean_exit(code, status))
+ return true;
+
+ return
+ code == CLD_EXITED &&
+ (status == EXIT_NOTINSTALLED || status == EXIT_NOTCONFIGURED);
+}
+
bool is_device_path(const char *path) {
/* Returns true on paths that refer to a device, either in