main: Avoid two error variables in the same function
This also fixes a superfluous additional `NULL` assignment right after declaring error and setting it to NULL.
This commit is contained in:
@ -316,13 +316,10 @@ main (int argc, char **argv)
|
|||||||
// if text-input is used, as it can bring the keyboard in and out
|
// if text-input is used, as it can bring the keyboard in and out
|
||||||
|
|
||||||
GDBusConnection *connection = NULL;
|
GDBusConnection *connection = NULL;
|
||||||
GError *error = NULL;
|
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &err);
|
||||||
error = NULL;
|
|
||||||
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
|
|
||||||
if (connection == NULL) {
|
if (connection == NULL) {
|
||||||
g_printerr ("Can't connect to the bus: %s. "
|
g_printerr ("Can't connect to the bus: %s. "
|
||||||
"Visibility switching unavailable.", error->message);
|
"Visibility switching unavailable.", err->message);
|
||||||
g_error_free (error);
|
|
||||||
}
|
}
|
||||||
guint owner_id = 0;
|
guint owner_id = 0;
|
||||||
DBusHandler *service = NULL;
|
DBusHandler *service = NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user