summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2011-11-29 23:07:38 -0500
committerMatthias Clasen <mclasen@redhat.com>2011-11-29 23:07:38 -0500
commit726343c9b597256c523c920b39a83b66f5b5f86a (patch)
tree1cf9348cc35efdcc7e9b11386b3a763d62a4507b
parentd1ceb834ebfaa20fcf582ab9191cc5fb9fde46f6 (diff)
Be more careful when resetting the users icons
When the current icon is in /usr/share, and we reset the icon, we try to delete a nonexisting icon file in /var/lib/AccountsService/icons. Deal with this eventuality.
-rw-r--r--src/user.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/user.c b/src/user.c
index e0e9445..fbc91be 100644
--- a/src/user.c
+++ b/src/user.c
@@ -1397,7 +1397,8 @@ user_change_icon_file_authorized_cb (Daemon *daemon,
g_free (dest_path);
error = NULL;
- if (!g_file_delete (dest, NULL, &error)) {
+ if (!g_file_delete (dest, NULL, &error) &&
+ !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) {
g_object_unref (dest);
throw_error (context, ERROR_FAILED, "failed to remove user icon, %s", error->message);
g_error_free (error);