]> err.no Git - systemd/commitdiff
systemctl: accept -p more than once
authorLennart Poettering <lennart@poettering.net>
Fri, 23 Jul 2010 03:24:05 +0000 (05:24 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 23 Jul 2010 03:24:05 +0000 (05:24 +0200)
fixme
man/systemctl.xml
src/systemctl.c

diff --git a/fixme b/fixme
index ec2f7211798f1440e8b2e0f06b4abcb78fa6b0d8..286651a3f2f0877aea2c8ab343d79c0989a251c4 100644 (file)
--- a/fixme
+++ b/fixme
@@ -53,6 +53,8 @@
 
 * io priority during initialization
 
+* if a service fails too often, make the service enter maintainence mode, and the socket, too.
+
 External:
 
 * default.target must be %ghosted...
index b8e00b6d5cc02bb88d744f29c249bf0f020727b4..678bf0b2eeaffaa1b082392e614159867a1c744f 100644 (file)
                                 not specified all set properties are
                                 shown. The argument should be a
                                 property name, such as
-                                <literal>MainPID</literal>.</para></listitem>
+                                <literal>MainPID</literal>. If
+                                specified more than once all
+                                properties with the specified names
+                                are shown.</para></listitem>
                         </varlistentry>
 
                         <varlistentry>
index d78294b6d8da2d064e5b4d0823981c6a2bc4d556..de928c56610e513a3b5b1a2e6319119138afbe66 100644 (file)
@@ -47,7 +47,7 @@
 #include "list.h"
 
 static const char *arg_type = NULL;
-static const char *arg_property = NULL;
+static char **arg_property = NULL;
 static bool arg_all = false;
 static bool arg_fail = false;
 static bool arg_session = false;
@@ -1702,7 +1702,7 @@ static int print_property(const char *name, DBusMessageIter *iter) {
         /* This is a low-level property printer, see
          * print_status_info() for the nicer output */
 
-        if (arg_property && !streq(name, arg_property))
+        if (arg_property && !strv_find(arg_property, name))
                 return 0;
 
         switch (dbus_message_iter_get_arg_type(iter)) {
@@ -3089,14 +3089,21 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
                         arg_type = optarg;
                         break;
 
-                case 'p':
-                        arg_property = optarg;
+                case 'p': {
+                        char **l;
+
+                        if (!(l = strv_append(arg_property, optarg)))
+                                return -ENOMEM;
+
+                        strv_free(arg_property);
+                        arg_property = l;
 
                         /* If the user asked for a particular
                          * property, show it to him, even if it is
                          * empty. */
                         arg_all = true;
                         break;
+                }
 
                 case 'a':
                         arg_all = true;
@@ -3927,5 +3934,7 @@ finish:
 
         dbus_shutdown();
 
+        strv_free(arg_property);
+
         return retval;
 }