projects
/
tinc
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
98de35c
)
Kill the parent after any error conditions in detach().
author
Ivo Timmermans
<ivo@lychnis.net>
Tue, 28 Mar 2000 19:09:52 +0000
(19:09 +0000)
committer
Ivo Timmermans
<ivo@lychnis.net>
Tue, 28 Mar 2000 19:09:52 +0000
(19:09 +0000)
src/tincd.c
patch
|
blob
|
history
diff --git
a/src/tincd.c
b/src/tincd.c
index
124276f
..
0da27a3
100644
(file)
--- a/
src/tincd.c
+++ b/
src/tincd.c
@@
-181,10
+181,11
@@
int detach(void)
close(fd);
}
close(fd);
}
- kill(ppid, SIGTERM);
-
if(setsid() < 0)
return -1;
if(setsid() < 0)
return -1;
+
+ kill(ppid, SIGTERM);
+
chdir("/"); /* avoid keeping a mointpoint busy */
openlog(identname, LOG_CONS | LOG_PID, LOG_DAEMON);
chdir("/"); /* avoid keeping a mointpoint busy */
openlog(identname, LOG_CONS | LOG_PID, LOG_DAEMON);
@@
-343,7
+344,10
@@
main(int argc, char **argv, char **envp)
setup_signals();
if(detach())
setup_signals();
if(detach())
- cleanup_and_exit(1);
+ {
+ kill(ppid, SIGTERM);
+ exit(0);
+ }
if(security_init())
return 1;
if(security_init())
return 1;
@@
-432,10
+436,10
@@
RETSIGTYPE
sighuh(int a)
{
if(cp_file)
sighuh(int a)
{
if(cp_file)
- syslog(LOG_NOTICE, "Got unexpected signal after %s line %d.",
- cp_file, cp_line);
+ syslog(LOG_NOTICE, "Got unexpected signal
(%d)
after %s line %d.",
+
a,
cp_file, cp_line);
else
else
- syslog(LOG_NOTICE, "Got unexpected signal
."
);
+ syslog(LOG_NOTICE, "Got unexpected signal
(%d).", a
);
}
void
}
void