if(link(health.log_filename, old_filename) == -1 && errno != ENOENT)
error("Health: cannot move file '%s' to '%s'.", health.log_filename, old_filename);
- // open it with truncate
- health.log_fp = fopen(health.log_filename, "w");
-
- if(health.log_fp)
- fclose(health.log_fp);
- else
- error("Health: cannot truncate health log '%s'", health.log_filename);
-
- health.log_fp = NULL;
+ if(unlink(health.log_filename) == -1 && errno != ENOENT)
+ error("Health: cannot remove old alarms log file '%s'", health.log_filename);
health_alarm_log_open();
}