+ if (fstatfs(cur_fd, &statfs) && cur_fd!=START_VALUE) {
+ my_log(LOG_ERR, "PANIC! Can't stat disk to calculate free blocks");
+ }
+ else {
+ if (min_free && statfs.f_bfree < min_free)
+ switch(cur_epoch) {
+ case 0: /* Uh oh. Our first file filled up all of the free space. Just bail out. */
+ my_log(LOG_ERR, "The first epoch filled up all the free space on disk. Bailing out.");
+ exit(1);
+ default:
+ my_log(LOG_INFO, "Disk almost full. I'm going to drop data. Max epochs = %d\n",cur_epoch);
+ cur_epoch = -1;
+ }
+ }
+
+ /* Epoch length in minutes */
+ if ((cur_uptime - prev_uptime) > epoch_length || cur_fd<0 || cur_epoch==-1) {