fixed bugs

This commit is contained in:
2023-11-28 11:19:23 +03:00
parent 0c8908b52b
commit e6fb720604
4 changed files with 11 additions and 12 deletions

View File

@@ -80,8 +80,6 @@ int main(int argc, char **argv){
if(G.logfile) OPENLOG(G.logfile, lvl, 1);
LOGMSG("hello, start");
LOGDBG("SQLite version: %s", sqlite3_libversion());
int sock = open_socket(G.server, G.port);
if(sock < 0) ERRX("Can't open socket to %s:%s", G.server, G.port);
check4running(self, G.pidfile);
// signal reactions:
signal(SIGTERM, signals); // kill (-15) - quit
@@ -110,6 +108,8 @@ int main(int argc, char **argv){
}
#endif
if(!opendb(G.dbname)) return 1;
int sock = open_socket(G.server, G.port);
if(sock < 0) ERRX("Can't open socket to %s:%s", G.server, G.port);
run_socket(sock);
LOGERR("Unreachable code reached");
signals(1);