Changeset: 4b5f6db5a2a2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4b5f6db5a2a2
Modified Files:
        gdk/gdk_bbp.c
Branch: Oct2020
Log Message:

Only report error if there was actually an error.


diffs (31 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -3039,9 +3039,9 @@ do_backup(const char *srcdir, const char
                                                  subcommit ? SUBDIR : BAKDIR,
                                                  nme, ext);
                } else if (subcommit) {
-                       /* if subcommit, wqe may need to move an
+                       /* if subcommit, we may need to move an
                         * already made backup from BAKDIR to
-                        * SUBSIR */
+                        * SUBDIR */
                        if (file_exists(h->farmid, BAKDIR, nme, extnew))
                                mvret = file_move(h->farmid, BAKDIR, SUBDIR, 
nme, extnew);
                        else if (file_exists(h->farmid, BAKDIR, nme, ext))
@@ -3218,11 +3218,10 @@ BBPsync(int cnt, bat *subcommit)
                 * succeeded, so no changing of ret after this
                 * call anymore */
 
-               if (rename(bakdir, deldir) < 0)
-                       ret = GDK_FAIL;
-               if (ret != GDK_SUCCEED &&
-                   GDKremovedir(0, DELDIR) == GDK_SUCCEED && /* maybe there 
was an old deldir */
-                   rename(bakdir, deldir) < 0)
+               if (rename(bakdir, deldir) < 0 &&
+                   /* maybe there was an old deldir, so remove and try again */
+                   (GDKremovedir(0, DELDIR) != GDK_SUCCEED ||
+                    rename(bakdir, deldir) < 0))
                        ret = GDK_FAIL;
                if (ret != GDK_SUCCEED)
                        GDKsyserror("BBPsync: rename(%s,%s) failed.\n", bakdir, 
deldir);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to