mirror of
https://github.com/kakwa/uts-server
synced 2025-01-10 05:34:29 +01:00
fix ordering between daemonize and get working dir
This commit is contained in:
parent
d6a7ba86ff
commit
7401799cb5
@ -63,9 +63,6 @@ int main(int argc, char **argv) {
|
|||||||
argp_parse(&argp, argc, argv, 0, 0, &args);
|
argp_parse(&argp, argc, argv, 0, 0, &args);
|
||||||
int ret = EXIT_SUCCESS;
|
int ret = EXIT_SUCCESS;
|
||||||
|
|
||||||
if (args.daemonize)
|
|
||||||
skeleton_daemon();
|
|
||||||
|
|
||||||
// get the current path, the configuration can be relative to this path
|
// get the current path, the configuration can be relative to this path
|
||||||
char conf_wd[PATH_MAX];
|
char conf_wd[PATH_MAX];
|
||||||
if (getcwd(conf_wd, sizeof(conf_wd)) == NULL){
|
if (getcwd(conf_wd, sizeof(conf_wd)) == NULL){
|
||||||
@ -73,6 +70,9 @@ int main(int argc, char **argv) {
|
|||||||
return EXIT_FAILURE;
|
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);
|
syslog(LOG_NOTICE, "uts-server daemon starting with conf '%s' from working dir '%s'", args.conffile, conf_wd);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user