ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

mg_stop closes stderr #111

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
If you don't set an error log, mongoose uses stderr by default. When you 
call mg_stop() ctx->error_log will always be set so fclose will be called 
on stderr.

That was conflicting with our application. I think mongoose should not 
close stderr but leave it untouched in case the main application is using 
it.

The proposed change is:

mongoose.c:3893

/* Close log files */
if (ctx->access_log && ctx->access_log != stderr )
    (void) fclose(ctx->access_log);
if (ctx->error_log && ctx->error_log != stderr )
    (void) fclose(ctx->error_log);

As an alternative stderr could not be the default and mongoose will not 
log any errors unless the user sets a log.

Original issue reported on code.google.com by pedro.na...@gmail.com on 6 Jan 2010 at 3:02

GoogleCodeExporter commented 9 years ago

Original comment by valenok on 10 Jan 2010 at 7:18

GoogleCodeExporter commented 9 years ago
This is fixed as of http://code.google.com/p/mongoose/source/detail?r=494

Original comment by valenok on 21 Apr 2010 at 1:40