treat error on stating locked file more seriously
authorAleš Křenek <ljocha@ics.muni.cz>
Thu, 22 Mar 2007 10:42:14 +0000 (10:42 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Thu, 22 Mar 2007 10:42:14 +0000 (10:42 +0000)
org.glite.lb.logger/src/event_store.c

index 4d7ca6b..6b7b3ce 100644 (file)
@@ -407,7 +407,10 @@ event_store_recover(struct event_store *es)
   /* check the file modification time and size to avoid unnecessary operations */
   memset(&stbuf, 0, sizeof(stbuf));
   if(fstat(fd, &stbuf) < 0) {
-         il_log(LOG_WARNING, "    could not stat event file %s: %s\n    continuing anyway\n", es->event_file_name, strerror(errno));
+         il_log(LOG_ERR, "    could not stat event file %s: %s\n", es->event_file_name, strerror(errno));
+         fclose(ef);
+         event_store_unlock(es);
+         return -1;
   } else {
          if((es->offset == stbuf.st_size) && (es->last_modified == stbuf.st_mtime)) {
                  il_log(LOG_DEBUG, "  event file not modified since last visit, skipping\n");