//not sure about this. Are the atexit() functions called by FIFO or LIFO order? The end result is PROBABLY the same
static void
cleanup_log(void)
{
//counter--;
//if(counter <= 0){
if(counter == 1){
syslogit = TRUE;
fflush(syslog_file);
fclose(syslog_file);
syslog_file = NULL;
counter = 0;
}
}