Test log isn't actually stderr before closing it

This commit is contained in:
Alexey Romanov
2012-06-18 20:34:08 +04:00
parent 398f02c039
commit 193baaaf7e

View File

@@ -137,7 +137,7 @@ static void stop(ErlDrvData handle) {
driver_free(driver_data->prepared_stmts);
}
sqlite3_close(driver_data->db);
if (driver_data->log) {
if (driver_data->log && (driver_data->log != stderr)) {
fclose(driver_data->log);
}
driver_data->log = NULL;