Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31774

Modified Files:
      Tag: MonetDB_5-2
        mal_box.mx 
Log Message:
On Windows, rename fails if the destination already exists (unlike
Linux), so remove destination before rename, but after we have
ascertained that the source exists.
Also, fix the debug print.


Index: mal_box.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_box.mx,v
retrieving revision 1.80
retrieving revision 1.80.4.1
diff -u -d -r1.80 -r1.80.4.1
--- mal_box.mx  16 Jul 2007 13:25:10 -0000      1.80
+++ mal_box.mx  28 Nov 2007 16:26:47 -0000      1.80.4.1
@@ -633,9 +633,10 @@
                showException(MAL, "box.saveBox", "can not determine box file");
                return 0;
        }
-       if (access(*boxfile,R_OK)==0 && rename(*boxfile, *boxfilebak)) {
+       if (access(*boxfile,R_OK)==0 &&
+               (unlink(*boxfilebak), rename(*boxfile, *boxfilebak) < 0)) {
 #ifdef DEBUG_MAL_BOX
-               stream_printf(GDKout, "saveBox:can not rename %s\n", boxfile);
+               stream_printf(GDKout, "saveBox:can not rename %s to %s\n", 
*boxfile, *boxfilebak);
 #endif
                showException(MAL,"box.saveBox", "can not rename backup");
                GDKfree(*boxfile); *boxfile = NULL;


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to