Opened 17 years ago
Closed 17 years ago
#1970 closed defect (fixed)
MS_ERRORFILE stderr/stdout - only first error reported
Reported by: | warmerdam | Owned by: | sdlime |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | MapServer C Library | Version: | 4.10 |
Severity: | normal | Keywords: | |
Cc: |
Description
When MS_ERRORFILE is set to seterr or stdout only the first error message actually gets reported. This is because the following code segment ends up fclose()ing stderr or stdout after their first use. if(errfile) { if(strcmp(errfile, "stderr") == 0) errstream = stderr; else if(strcmp(errfile, "stdout") == 0) errstream = stdout; else errstream = fopen(errfile, "a"); if(!errstream) return; errtime = time(NULL); fprintf(errstream, "%s - %s: %s %s\n", chop(ctime(&errtime)), ms_error->routine, ms_errorCodes[ms_error->code], ms_error->message); fclose(errstream); } The correction is to change the fclose() line to: if( errstream != stderr && errstream != stdout ) fclose(errstream);
Note:
See TracTickets
for help on using tickets.