[xdg-desktop-portal-gnome/wip/rishi/coverity-fixes-01: 4/4] wallpaper: Handle the error when storing an image in the cache
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [xdg-desktop-portal-gnome/wip/rishi/coverity-fixes-01: 4/4] wallpaper: Handle the error when storing an image in the cache
- Date: Sat, 2 Jul 2022 16:38:02 +0000 (UTC)
commit 994b8d9c8dde5f511b5411d9196066bbdefb5354
Author: Debarshi Ray <debarshir gnome org>
Date: Sat Jul 2 18:24:24 2022 +0200
wallpaper: Handle the error when storing an image in the cache
https://gitlab.gnome.org/GNOME/xdg-desktop-portal-gnome/-/merge_requests/46
src/wallpaper.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/src/wallpaper.c b/src/wallpaper.c
index 5bb2dc5..85e0bcc 100644
--- a/src/wallpaper.c
+++ b/src/wallpaper.c
@@ -107,13 +107,17 @@ on_file_copy_cb (GObject *source_object,
}
destination = g_file_new_for_path (handle->picture_uri);
- g_file_replace_contents (destination,
- contents,
- length,
- NULL, FALSE,
- G_FILE_CREATE_REPLACE_DESTINATION,
- NULL, NULL,
- &error);
+ if (!g_file_replace_contents (destination,
+ contents,
+ length,
+ NULL, FALSE,
+ G_FILE_CREATE_REPLACE_DESTINATION,
+ NULL, NULL,
+ &error))
+ {
+ g_warning ("Failed to store image as '%s': %s", handle->picture_uri, error->message);
+ goto out;
+ }
if (set_gsettings (BACKGROUND_SCHEMA, handle->picture_uri))
handle->response = 0;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]