You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
3.4 KiB
67 lines
3.4 KiB
From d2a9e9536aa881c130af938ccdc444252fff6412 Mon Sep 17 00:00:00 2001
|
|
From: David Tardon <dtardon@redhat.com>
|
|
Date: Tue, 23 May 2023 10:48:15 +0200
|
|
Subject: [PATCH] loginctl: shorten variable name
|
|
|
|
(cherry picked from commit 86f128558d57586bd28c55eb63968eab3dc4b36e)
|
|
|
|
Related: #2209912
|
|
---
|
|
src/login/loginctl.c | 16 ++++++++--------
|
|
1 file changed, 8 insertions(+), 8 deletions(-)
|
|
|
|
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
|
|
index 0bea31796d..fad09cbe55 100644
|
|
--- a/src/login/loginctl.c
|
|
+++ b/src/login/loginctl.c
|
|
@@ -141,7 +141,7 @@ static int list_sessions(int argc, char *argv[], void *userdata) {
|
|
(void) table_set_align_percent(table, TABLE_HEADER_CELL(1), 100);
|
|
|
|
for (;;) {
|
|
- _cleanup_(sd_bus_error_free) sd_bus_error error_property = SD_BUS_ERROR_NULL;
|
|
+ _cleanup_(sd_bus_error_free) sd_bus_error e = SD_BUS_ERROR_NULL;
|
|
_cleanup_free_ char *tty = NULL, *state = NULL;
|
|
const char *id, *user, *seat, *object;
|
|
uint32_t uid;
|
|
@@ -157,17 +157,17 @@ static int list_sessions(int argc, char *argv[], void *userdata) {
|
|
object,
|
|
"org.freedesktop.login1.Session",
|
|
"TTY",
|
|
- &error_property,
|
|
+ &e,
|
|
&tty);
|
|
if (r < 0) {
|
|
- if (sd_bus_error_has_name(&error_property, SD_BUS_ERROR_UNKNOWN_OBJECT))
|
|
+ if (sd_bus_error_has_name(&e, SD_BUS_ERROR_UNKNOWN_OBJECT))
|
|
/* The session is already closed when we're querying the property */
|
|
continue;
|
|
|
|
log_warning_errno(r, "Failed to get TTY for session %s, ignoring: %s",
|
|
- id, bus_error_message(&error_property, r));
|
|
+ id, bus_error_message(&e, r));
|
|
|
|
- sd_bus_error_free(&error_property);
|
|
+ sd_bus_error_free(&e);
|
|
}
|
|
|
|
r = sd_bus_get_property_string(bus,
|
|
@@ -175,15 +175,15 @@ static int list_sessions(int argc, char *argv[], void *userdata) {
|
|
object,
|
|
"org.freedesktop.login1.Session",
|
|
"State",
|
|
- &error_property,
|
|
+ &e,
|
|
&state);
|
|
if (r < 0) {
|
|
- if (sd_bus_error_has_name(&error_property, SD_BUS_ERROR_UNKNOWN_OBJECT))
|
|
+ if (sd_bus_error_has_name(&e, SD_BUS_ERROR_UNKNOWN_OBJECT))
|
|
/* The session is already closed when we're querying the property */
|
|
continue;
|
|
|
|
return log_error_errno(r, "Failed to get state for session %s: %s",
|
|
- id, bus_error_message(&error_property, r));
|
|
+ id, bus_error_message(&e, r));
|
|
}
|
|
|
|
r = table_add_many(table,
|