chiark / gitweb /
unit-name: style fix in unit_name_is_template()
[elogind.git] / src / login / loginctl.c
index 18f56f0124a795fbcc429b3488968050b6d66a3e..7b751e778fa29d4dc826d28b339de115da4e78b7 100644 (file)
@@ -364,7 +364,7 @@ typedef struct SessionStatusInfo {
         pid_t leader;
         const char *type;
         const char *class;
-        bool active;
+        const char *state;
 } SessionStatusInfo;
 
 typedef struct UserStatusInfo {
@@ -458,8 +458,8 @@ static void print_session_status_info(SessionStatusInfo *i) {
         } else if (i->class)
                 printf("\t   Class: %s\n", i->class);
 
-
-        printf("\t  Active: %s\n", yes_no(i->active));
+        if (i->state)
+                printf("\t   State: %s\n", i->state);
 
         if (i->default_control_group) {
                 unsigned c;
@@ -597,6 +597,8 @@ static int status_property_session(const char *name, DBusMessageIter *iter, Sess
                                 i->type = s;
                         else if (streq(name, "Class"))
                                 i->class = s;
+                        else if (streq(name, "State"))
+                                i->state = s;
                 }
                 break;
         }
@@ -621,8 +623,6 @@ static int status_property_session(const char *name, DBusMessageIter *iter, Sess
 
                 if (streq(name, "Remote"))
                         i->remote = b;
-                else if (streq(name, "Active"))
-                        i->active = b;
 
                 break;
         }
@@ -1089,7 +1089,7 @@ static int show(DBusConnection *bus, char **args, unsigned n) {
                         uid_t uid;
                         uint32_t u;
 
-                        ret = get_user_creds((const char**) (args+i), &uid, NULL, NULL);
+                        ret = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL);
                         if (ret < 0) {
                                 log_error("User %s unknown.", args[i]);
                                 goto finish;
@@ -1320,7 +1320,7 @@ static int enable_linger(DBusConnection *bus, char **args, unsigned n) {
                         goto finish;
                 }
 
-                ret = get_user_creds((const char**) (args+i), &uid, NULL, NULL);
+                ret = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL);
                 if (ret < 0) {
                         log_error("Failed to resolve user %s: %s", args[i], strerror(-ret));
                         goto finish;
@@ -1387,7 +1387,7 @@ static int terminate_user(DBusConnection *bus, char **args, unsigned n) {
                         goto finish;
                 }
 
-                ret = get_user_creds((const char**) (args+i), &uid, NULL, NULL);
+                ret = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL);
                 if (ret < 0) {
                         log_error("Failed to look up user %s: %s", args[i], strerror(-ret));
                         goto finish;
@@ -1455,7 +1455,7 @@ static int kill_user(DBusConnection *bus, char **args, unsigned n) {
                         goto finish;
                 }
 
-                ret = get_user_creds((const char**) (args+i), &uid, NULL, NULL);
+                ret = get_user_creds((const char**) (args+i), &uid, NULL, NULL, NULL);
                 if (ret < 0) {
                         log_error("Failed to look up user %s: %s", args[i], strerror(-ret));
                         goto finish;