]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bus-unit-util: use STR_IN_SET() where appropriate 6708/head
authorLennart Poettering <lennart@poettering.net>
Thu, 31 Aug 2017 08:25:48 +0000 (10:25 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 31 Aug 2017 13:45:04 +0000 (15:45 +0200)
src/shared/bus-unit-util.c

index d38eede4665ded6152bd567cee7e53a0bc61ce0b..c024f64ca92452dc430c367c7f8e708f0b37f52d 100644 (file)
@@ -1227,7 +1227,7 @@ static int check_wait_response(BusWaitForJobs *d, bool quiet, const char* const*
                         log_error("Operation on or unit type of %s not supported on this system.", strna(d->name));
                 else if (streq(d->result, "collected"))
                         log_error("Queued job for %s was garbage collected.", strna(d->name));
-                else if (!streq(d->result, "done") && !streq(d->result, "skipped")) {
+                else if (!STR_IN_SET(d->result, "done", "skipped")) {
                         if (d->name) {
                                 _cleanup_free_ char *result = NULL;
                                 int q;
@@ -1254,7 +1254,7 @@ static int check_wait_response(BusWaitForJobs *d, bool quiet, const char* const*
                 r = -EPROTO;
         else if (streq(d->result, "unsupported"))
                 r = -EOPNOTSUPP;
-        else if (!streq(d->result, "done") && !streq(d->result, "skipped"))
+        else if (!STR_IN_SET(d->result, "done", "skipped"))
                 r = -EIO;
 
         return r;