about summary refs log tree commit diff
path: root/src/libutil
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/util.cc6
-rw-r--r--src/libutil/util.hh2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index d4345eac3699..5fb553d6dd52 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -611,3 +611,9 @@ string statusToString(int status)
             return "died abnormally";
     } else return "succeeded";
 }
+
+
+bool statusOk(int status)
+{
+    return WIFEXITED(status) && WEXITSTATUS(status) == 0;
+}
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
index 67661eb5f882..13f28dc221b8 100644
--- a/src/libutil/util.hh
+++ b/src/libutil/util.hh
@@ -243,5 +243,7 @@ Strings unpackStrings(const string & s);
    error string. */
 string statusToString(int status);
 
+bool statusOk(int status);
+
 
 #endif /* !__UTIL_H */