Only chdir("/") when detaching from TTY and backgrounding process
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
4f5124cb79
commit
e9a546c683
@ -405,9 +405,6 @@ int main(int argc, char *argv[])
|
||||
int num_fds, maxfds;
|
||||
int i, ch;
|
||||
|
||||
#ifndef TESTING
|
||||
chdir("/");
|
||||
#endif
|
||||
for (i = 1; i < MAXFUNIX; i++) {
|
||||
funixn[i] = "";
|
||||
funix[i] = -1;
|
||||
@ -506,6 +503,8 @@ int main(int argc, char *argv[])
|
||||
logit("Checking pidfile.\n");
|
||||
if (!check_pid(PidFile)) {
|
||||
signal(SIGTERM, doexit);
|
||||
chdir("/");
|
||||
|
||||
if (fork()) {
|
||||
/*
|
||||
* Parent process
|
||||
|
Loading…
Reference in New Issue
Block a user