Update of /cvsroot/monetdb/MonetDB5/src/mal
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv27475
Modified Files:
mal_sabaoth.mx
Log Message:
Check that the thing to add to the sabdb structure is indeed a directory
pointing to a valid database.
Index: mal_sabaoth.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/mal/mal_sabaoth.mx,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- mal_sabaoth.mx 18 Aug 2007 13:07:09 -0000 1.29
+++ mal_sabaoth.mx 18 Aug 2007 23:15:15 -0000 1.30
@@ -40,6 +40,8 @@
#include "mal_sabaoth.h"
#include <stdio.h> /* fseek, rewind */
#include <unistd.h> /* unlink and friends */
+#include <sys/types.h>
+#include <sys/stat.h>
#include <errno.h>
#include <string.h> /* for getting error messages */
#include <assert.h>
@@ -434,6 +436,7 @@
str p;
FILE *f;
int fd;
+ struct stat statbuf;
sabdb *sdb, *top;
sdb = top = *ret = NULL;
@@ -449,6 +452,12 @@
while ((e = readdir(d)) != NULL) {
if (dbname != NULL && strcmp(e->d_name, dbname) != 0)
continue;
+ if (strcmp(e->d_name, "..") == 0 || strcmp(e->d_name, ".") == 0)
+ continue;
+
+ snprintf(buf, PATHLENGTH, "%s/%s/%s", path, e->d_name,
UPLOGFILE);
+ if (stat(buf, &statbuf) == -1)
+ continue;
if (sdb == NULL) {
top = sdb = malloc(sizeof(sabdb));
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins