Merge pull request #8 from rflynn/master

re: issue #7: logfile -> crash
This commit is contained in:
Alexey Romanov
2012-03-16 01:59:36 -07:00

View File

@@ -63,7 +63,9 @@ 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, "Can't create log file\n"); fprintf(stderr, "Error creating log file: %s\n", LOG_PATH);
// if we can't open the log file we shouldn't hide the data or the problem
retval->log = stderr; // noisy
} }
fprintf(retval->log, fprintf(retval->log,