/* XXX return value */
parse_config(config, &conf);
- db_conn = PQconnectdb(conf.dbdef);
- if (PQstatus(db_conn) != CONNECTION_OK) {
- syslog(LOG_ERR, "connection to database failed: %s",
- PQerrorMessage(db_conn));
- exit(1);
- }
d = MHD_start_daemon(MHD_USE_DEBUG,
conf.port,
NULL, /* Access policy handler */
exit(1);
}
+ db_conn = PQconnectdb(conf.dbdef);
+ if (PQstatus(db_conn) != CONNECTION_OK) {
+ syslog(LOG_ERR, "connection to database failed: %s",
+ PQerrorMessage(db_conn));
+ exit(1);
+ }
+
if (!foreground)
daemon(0, 0);