diff -ur nsca-2.7.2.original/src/nsca.c nsca-2.7.2/src/nsca.c --- nsca-2.7.2.original/src/nsca.c 2007-07-03 20:57:28.000000000 +0100 +++ nsca-2.7.2/src/nsca.c 2008-01-08 13:40:26.000000000 +0000 @@ -53,6 +53,7 @@ int sigrestart=FALSE; int sigshutdown=FALSE; +int using_alternate_dump_file=FALSE; static FILE *command_file_fp=NULL; struct handler_entry *rhand=NULL; @@ -923,7 +924,7 @@ } /* open the command file if we're aggregating writes */ - if(aggregate_writes==TRUE && !command_file_fp){ + if(aggregate_writes==TRUE){ if(open_command_file()==ERROR){ close(sock); if(mode==MULTI_PROCESS_DAEMON) @@ -1119,7 +1120,7 @@ struct stat statbuf; /* file is already open */ - if(command_file_fp!=NULL) + if(command_file_fp!=NULL && using_alternate_dump_file==FALSE) return OK; /* command file doesn't exist - monitoring app probably isn't running... */ @@ -1135,6 +1136,7 @@ syslog(LOG_ERR,"Could not open alternate dump file '%s' for appending",alternate_dump_file); return ERROR; } + using_alternate_dump_file=TRUE; return OK; } @@ -1147,6 +1149,7 @@ return ERROR; } + using_alternate_dump_file=FALSE; return OK; }