Skip to content
This repository has been archived by the owner on Mar 12, 2019. It is now read-only.

Commit

Permalink
log if connection to backend fails
Browse files Browse the repository at this point in the history
	closes #160
  • Loading branch information
jpmens committed Dec 22, 2016
1 parent 8a799ba commit 4bb8b4e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions be-mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ void *be_mysql_init()
}

if (!mysql_real_connect(conf->mysql, host, user, pass, dbname, port, NULL, 0)) {
fprintf(stderr, "%s\n", mysql_error(conf->mysql));
if (!conf->auto_connect && !reconnect) {
free(conf);
mysql_close(conf->mysql);
return (NULL);
}
_log(LOG_NOTICE, "%s", mysql_error(conf->mysql));
if (!conf->auto_connect && !reconnect) {
free(conf);
mysql_close(conf->mysql);
return (NULL);
}
}

return ((void *)conf);
Expand Down

0 comments on commit 4bb8b4e

Please sign in to comment.