don't hide the problem, use stderr instead
This commit is contained in:
@@ -64,11 +64,8 @@ static ErlDrvData start(ErlDrvPort port, char* cmd) {
|
|||||||
retval->log = fopen(LOG_PATH, "a+");
|
retval->log = fopen(LOG_PATH, "a+");
|
||||||
if (!retval->log) {
|
if (!retval->log) {
|
||||||
fprintf(stderr, "Error creating log file: %s\n", LOG_PATH);
|
fprintf(stderr, "Error creating log file: %s\n", LOG_PATH);
|
||||||
// because logging isn't abstracted away we need a valid FILE*
|
// if we can't open the log file we shouldn't hide the data or the problem
|
||||||
// fall back to anything rather than segfault later
|
retval->log = stderr; // noisy
|
||||||
retval->log = fopen("/dev/null", "a+");
|
|
||||||
if (!retval->log)
|
|
||||||
retval->log = stderr; // noisy
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(retval->log,
|
fprintf(retval->log,
|
||||||
|
|||||||
Reference in New Issue
Block a user