From 824adcea32a4b756fac567733b7dfb646d21626b Mon Sep 17 00:00:00 2001 From: Ryan Flynn Date: Wed, 14 Mar 2012 11:09:23 -0400 Subject: [PATCH] don't hide the problem, use stderr instead --- c_src/sqlite3_drv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/c_src/sqlite3_drv.c b/c_src/sqlite3_drv.c index 6ce5531..30b4774 100644 --- a/c_src/sqlite3_drv.c +++ b/c_src/sqlite3_drv.c @@ -64,11 +64,8 @@ static ErlDrvData start(ErlDrvPort port, char* cmd) { retval->log = fopen(LOG_PATH, "a+"); if (!retval->log) { fprintf(stderr, "Error creating log file: %s\n", LOG_PATH); - // because logging isn't abstracted away we need a valid FILE* - // fall back to anything rather than segfault later - retval->log = fopen("/dev/null", "a+"); - if (!retval->log) - retval->log = stderr; // noisy + // if we can't open the log file we shouldn't hide the data or the problem + retval->log = stderr; // noisy } fprintf(retval->log,