1
0
mirror of https://github.com/kakwa/uts-server synced 2024-12-04 23:15:54 +01:00

fix ordering between daemonize and get working dir

This commit is contained in:
kakwa 2016-09-01 08:13:57 +02:00
parent 6e687f2fe2
commit 43984fd1b5

View File

@ -63,9 +63,6 @@ int main(int argc, char **argv) {
argp_parse(&argp, argc, argv, 0, 0, &args);
int ret = EXIT_SUCCESS;
if (args.daemonize)
skeleton_daemon();
// get the current path, the configuration can be relative to this path
char conf_wd[PATH_MAX];
if (getcwd(conf_wd, sizeof(conf_wd)) == NULL){
@ -73,6 +70,9 @@ int main(int argc, char **argv) {
return EXIT_FAILURE;
}
if (args.daemonize)
skeleton_daemon();
syslog(LOG_NOTICE, "uts-server daemon starting with conf '%s' from working dir '%s'", args.conffile, conf_wd);
while (1) {