shell-global: don't warn when unsetting non-existent state

If the state we're trying to delete does not exist, do not log an
error.
Prevents this journal warning at startup:

gnome-shell[1082]: Could not delete runtime/persistent state file: Error removing file /run/user/1000/gnome-shell/runtime-state-LE.:0/screenShield.locked: No such file or directory

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/555
This commit is contained in:
Cosimo Cecchi 2019-05-26 10:24:25 -07:00 committed by Bastien Nocera
parent b118c874da
commit 2483b60386

View File

@ -1560,7 +1560,8 @@ delete_variant_cb (GObject *object,
if (!g_file_delete_finish (G_FILE (object), result, &error))
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
{
g_warning ("Could not delete runtime/persistent state file: %s\n",
error->message);