Update of /cvsroot/monetdb/MonetDB5/src/tools
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv7706
Modified Files:
monetdb.mx
Log Message:
Don't bail out when removing directories that don't exist. Avoid
printing duplicate information.
Index: monetdb.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/tools/monetdb.mx,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- monetdb.mx 10 Sep 2007 11:02:21 -0000 1.36
+++ monetdb.mx 10 Sep 2007 11:22:19 -0000 1.37
@@ -678,9 +678,9 @@
buf[PATHLENGTH] = '\0';
d = opendir(dir);
if (d == NULL) {
- snprintf(data, 8095, "unable to open directory %s: %s",
- dir, strerror(errno));
- return(GDKstrdup(data));
+ /* silently return if we cannot find the directory; it's
+ * probably already deleted */
+ return(NO_ERR);
}
while ((e = readdir(d)) != NULL) {
snprintf(path, PATHLENGTH, "%s/%s", dir, e->d_name);
@@ -800,22 +800,23 @@
/* annoyingly we have to delete file by file, and
* directories recursively... */
if ((e = deletedir(stats->path)) != NULL) {
- fprintf(stderr, "destroy: failed to destroy
'%s': %s %s\n",
- argv[1], stats->path, e);
+ fprintf(stderr, "destroy: failed to destroy
'%s': %s\n",
+ argv[1], e);
GDKfree(e);
+ SABAOTHfreeStatus(&stats);
exit(1);
}
+ SABAOTHfreeStatus(&stats);
/* this is annoying, but till the time we have something
* better, we should do it like this; the logdir is a
* separate directory */
snprintf(buf, 8096, "%s/%s", logdir, argv[1]);
if ((e = deletedir(buf)) != NULL) {
- fprintf(stderr, "destroy: failed to destroy
'%s': %s %s\n",
- argv[1], buf, e);
+ fprintf(stderr, "destroy: failed to destroy
'%s': %s\n",
+ argv[1], e);
GDKfree(e);
exit(1);
}
- SABAOTHfreeStatus(&stats);
printf("successfully destroyed database '%s'\n",
dbname);
} else {
fprintf(stderr, "destroy: no such database: %s\n",
dbname);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins