47313b1
From ff0c10038b7dc58ad13dce492806e6781a0f34fc Mon Sep 17 00:00:00 2001
b397f2a
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
b397f2a
Date: Wed, 29 Oct 2014 22:51:00 -0400
b397f2a
Subject: [PATCH] systemctl: obey --state in list-unit-files
b397f2a
b397f2a
(cherry picked from commit fec1530e6b5b8d6dc352c7338010357126e84621)
b397f2a
---
b397f2a
 src/systemctl/systemctl.c | 5 +++++
b397f2a
 1 file changed, 5 insertions(+)
b397f2a
b397f2a
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
b397f2a
index b71040be40..8481a9b20c 100644
b397f2a
--- a/src/systemctl/systemctl.c
b397f2a
+++ b/src/systemctl/systemctl.c
b397f2a
@@ -1268,6 +1268,11 @@ next:
b397f2a
                         return false;
b397f2a
         }
b397f2a
 
b397f2a
+        if (!strv_isempty(arg_states)) {
b397f2a
+                if (!strv_find(arg_states, unit_file_state_to_string(u->state)))
b397f2a
+                        return false;
b397f2a
+        }
b397f2a
+
b397f2a
         return true;
b397f2a
 }
b397f2a