commit cbdbbbea9d14efc58b0da4e871a9fcdb8ce65ee6
Author: Christophe Fergeau <t...@gnome.org>
Date:   Fri Sep 24 18:13:07 2010 +0200

    [sqlite] Don't abort after the first copying error
    
    After my recent changes, the code copying the temporary sqlite files
    to the device would abort after the first copy error that happens.
    Change it so that it tries to copy as many files as possible and
    report the last error that occurred to be as close as the previous
    behaviour as possible.

 src/itdb_sqlite.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/itdb_sqlite.c b/src/itdb_sqlite.c
index 34fc6ab..69d8550 100644
--- a/src/itdb_sqlite.c
+++ b/src/itdb_sqlite.c
@@ -2079,13 +2079,22 @@ int itdb_sqlite_generate_itdbs(FExport *fexp)
                                     "Locations.itdb", "Locations.itdb.cbk",
                                     NULL };
        const char **file;
+       GError *error = NULL;
+       g_assert (fexp->error == NULL);
        for (file = itdb_files; *file != NULL; file++) {
-           copy_itdb_file(tmpdir, itlpdir, *file, &fexp->error);
-           if (fexp->error) {
+           copy_itdb_file(tmpdir, itlpdir, *file, &error);
+           if (error) {
                res = -1;
-               goto leave;
+               /* only the last error will be reported, but this way we
+                * copy as many files as possible even when errors occur
+                */
+               g_clear_error (&fexp->error);
+               g_propagate_error (&fexp->error, error);
            }
        }
+       if (fexp->error) {
+           goto leave;
+       }
     }
 
     res = 0;

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
gtkpod-cvs2 mailing list
gtkpod-cvs2@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to