diff options
author | Alessandro Bono <alessandro.bono369@gmail.com> | 2022-10-31 17:48:26 +0100 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2023-04-28 19:41:28 +0000 |
commit | 85ac788a6ec87b5ed6852616d51b1614fc1acc72 (patch) | |
tree | cf9bdee028c2775b37784bbf78915d2578e3f2f3 /daemon | |
parent | e2d4e84cc9af73158ca1653dfc44bfe73b5fd0af (diff) | |
download | gdm-85ac788a6ec87b5ed6852616d51b1614fc1acc72.tar.gz |
gdm-local-display-factory: Move variables to inner scope
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/gdm-local-display-factory.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/daemon/gdm-local-display-factory.c b/daemon/gdm-local-display-factory.c index 471e1b46..85671088 100644 --- a/daemon/gdm-local-display-factory.c +++ b/daemon/gdm-local-display-factory.c @@ -1142,18 +1142,19 @@ on_vt_changed (GIOChannel *source, GdmLocalDisplayFactory *factory) { GdmDisplayStore *store; - GIOStatus status; g_autofree char *tty_of_active_vt = NULL; g_autofree char *login_session_id = NULL; g_autofree char *active_session_id = NULL; unsigned int previous_vt, new_vt, login_window_vt = 0; - int ret, n_returned; + int n_returned; g_debug ("GdmLocalDisplayFactory: received VT change event"); g_io_channel_seek_position (source, 0, G_SEEK_SET, NULL); if (condition & G_IO_PRI) { g_autoptr (GError) error = NULL; + GIOStatus status; + status = g_io_channel_read_line (source, &tty_of_active_vt, NULL, NULL, &error); if (error != NULL) { @@ -1216,7 +1217,7 @@ on_vt_changed (GIOChannel *source, /* if the old VT was running a wayland login screen kill it */ if (gdm_get_login_window_session_id ("seat0", &login_session_id)) { - ret = sd_session_get_vt (login_session_id, &login_window_vt); + int ret = sd_session_get_vt (login_session_id, &login_window_vt); if (ret == 0 && login_window_vt != 0) { g_debug ("GdmLocalDisplayFactory: VT of login window is %u", login_window_vt); if (login_window_vt == previous_vt) { |