[gnome-initial-setup] copy-worker: Don't fail if we can't find the src file
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup] copy-worker: Don't fail if we can't find the src file
- Date: Sat, 6 Oct 2012 00:05:53 +0000 (UTC)
commit 5913fdd29559f9e0dc3467e94cb4654b7118f7b6
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Fri Oct 5 21:05:25 2012 -0300
copy-worker: Don't fail if we can't find the src file
In some cases, a src file not may be in the user's configuration.
Don't bail out if we can't find it.
.../gnome-initial-setup-copy-worker.c | 21 +++++++++----------
1 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/gnome-initial-setup/gnome-initial-setup-copy-worker.c b/gnome-initial-setup/gnome-initial-setup-copy-worker.c
index 9e6122e..f9a3ac8 100644
--- a/gnome-initial-setup/gnome-initial-setup-copy-worker.c
+++ b/gnome-initial-setup/gnome-initial-setup-copy-worker.c
@@ -24,14 +24,18 @@ move_file_from_tmpfs (GFile *src_base,
GFile *src = g_file_get_child (src_base, basename);
GError *error = NULL;
+ gboolean ret = TRUE;
if (!g_file_move (src, dest, G_FILE_COPY_NONE,
NULL, NULL, NULL, &error)) {
- g_warning ("Unable to move %s to %s: %s",
- g_file_get_path (src),
- g_file_get_path (dest),
- error->message);
- goto out;
+ if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND)) {
+ g_warning ("Unable to move %s to %s: %s",
+ g_file_get_path (src),
+ g_file_get_path (dest),
+ error->message);
+ ret = FALSE;
+ }
+ g_error_free (error);
}
out:
@@ -40,12 +44,7 @@ move_file_from_tmpfs (GFile *src_base,
g_object_unref (src);
g_free (basename);
- if (error != NULL) {
- g_error_free (error);
- return FALSE;
- } else {
- return TRUE;
- }
+ return ret;
}
int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]