Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid fatal errors on specific modules #401

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/gpm-brightness.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ gpm_brightness_helper_get_value (const gchar *argument)
ret = g_spawn_command_line_sync (command,
&stdout_data, NULL, &exit_status, &error);
if (!ret) {
g_error ("failed to get value: %s", error->message);
g_warning ("failed to get value: %s", error->message);
g_error_free (error);
goto out;
}
Expand Down Expand Up @@ -162,7 +162,7 @@ gpm_brightness_helper_set_value (const gchar *argument, gint value)
command = g_strdup_printf ("pkexec " SBINDIR "/mate-power-backlight-helper --%s %i", argument, value);
ret = g_spawn_command_line_sync (command, NULL, NULL, &exit_status, &error);
if (!ret) {
g_error ("failed to get value: %s", error->message);
g_warning ("failed to get value: %s", error->message);
g_error_free (error);
goto out;
}
Expand Down Expand Up @@ -261,7 +261,7 @@ gpm_brightness_setup_display (GpmBrightness *brightness)
/* get the display */
brightness->priv->dpy = GDK_DISPLAY_XDISPLAY (gdk_display_get_default());
if (!brightness->priv->dpy) {
g_error ("Cannot open display");
g_critical ("Cannot open display");
return FALSE;
}
/* is XRandR new enough? */
Expand Down
15 changes: 8 additions & 7 deletions src/gpm-button.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ gpm_button_is_lid_closed (GpmButton *button)
NULL,
&error );
if (proxy == NULL) {
g_error("Error connecting to dbus - %s", error->message);
g_warning ("Error connecting to dbus - %s", error->message);
g_error_free (error);
return -1;
goto err;
}

res = g_dbus_proxy_call_sync (proxy, "Get",
Expand All @@ -284,23 +284,24 @@ gpm_button_is_lid_closed (GpmButton *button)
NULL,
&error
);
g_object_unref(proxy);
if (error == NULL && res != NULL) {
g_variant_get(res, "(v)", &inner );
lid = g_variant_get_boolean(inner);
g_variant_unref (inner);
g_variant_unref (res);
return lid;
} else if (error != NULL ) {
g_error ("Error in dbus - %s", error->message);
g_warning ("Error in dbus - %s", error->message);
g_error_free (error);
goto err;
}
g_object_unref(proxy);

return FALSE;
}
else {
return up_client_get_lid_is_closed (button->priv->client);
}

err: /* fall back on our client in case of error */
return up_client_get_lid_is_closed (button->priv->client);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/gpm-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,7 @@ gpm_manager_systemd_inhibit (GDBusProxy *proxy) {
&error );
//append all our arguments
if (proxy == NULL) {
g_error ("Error connecting to dbus - %s", error->message);
g_warning ("Error connecting to dbus - %s", error->message);
g_error_free (error);
return -1;
}
Expand All @@ -1770,7 +1770,7 @@ gpm_manager_systemd_inhibit (GDBusProxy *proxy) {
&error
);
if (error != NULL) {
g_error ("Error in dbus - %s", error->message);
g_warning ("Error in dbus - %s", error->message);
g_error_free (error);
return -EIO;
}
Expand Down