chiark / gitweb /
systemctl,loginctl,cgls: do not ellipsize cgroup members when --full is specified
[elogind.git] / src / systemctl / systemctl.c
index d56b4d61e226835e14c358f9f1d4314779d913f1..a2ad0deb5af5e8626b744c9539159bc38040692e 100644 (file)
@@ -672,7 +672,7 @@ static int list_unit_files(DBusConnection *bus, char **args) {
                         UnitFileList *u;
                         const char *state;
 
-                        assert(dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_STRUCT);
+                        assert(dbus_message_iter_get_arg_type(&sub) == DBUS_TYPE_STRUCT);
 
                         if (c >= n_units) {
                                 UnitFileList *w;
@@ -1042,7 +1042,7 @@ static bool need_daemon_reload(DBusConnection *bus, const char *unit) {
         /* We ignore all errors here, since this is used to show a warning only */
 
         n = unit_name_mangle(unit);
-        if (n)
+        if (!n)
                 return log_oom();
 
         r = bus_method_call_with_reply (
@@ -2231,6 +2231,12 @@ static void print_status_info(UnitStatusInfo *i) {
         char since1[FORMAT_TIMESTAMP_RELATIVE_MAX], *s1;
         char since2[FORMAT_TIMESTAMP_MAX], *s2;
         const char *path;
+        int flags =
+                arg_all * OUTPUT_SHOW_ALL |
+                (!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
+                on_tty() * OUTPUT_COLOR |
+                !arg_quiet * OUTPUT_WARN_CUTOFF |
+                arg_full * OUTPUT_FULL_WIDTH;
 
         assert(i);
 
@@ -2454,17 +2460,11 @@ static void print_status_info(UnitStatusInfo *i) {
                         if (i->control_pid > 0)
                                 extra[k++] = i->control_pid;
 
-                        show_cgroup_and_extra_by_spec(i->default_control_group, "\t\t  ", c, false, arg_all, extra, k);
+                        show_cgroup_and_extra_by_spec(i->default_control_group, "\t\t  ", c, false, extra, k, flags);
                 }
         }
 
         if (i->id && arg_transport != TRANSPORT_SSH) {
-                int flags =
-                        arg_all * OUTPUT_SHOW_ALL |
-                        (!on_tty() || pager_have()) * OUTPUT_FULL_WIDTH |
-                        on_tty() * OUTPUT_COLOR |
-                        !arg_quiet * OUTPUT_WARN_CUTOFF;
-
                 printf("\n");
                 show_journal_by_unit(stdout,
                                      i->id,