c-daemon-2
This commit is contained in:
parent
b151c1c285
commit
f5a4df3bb3
2 changed files with 3 additions and 1 deletions
|
@ -20,5 +20,8 @@ int _daemon(int nochdir, int noclose){
|
|||
else if (pid > 0){
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (setsid() == -1){
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
|
@ -3,7 +3,6 @@
|
|||
int _daemon (int, int);
|
||||
|
||||
int main(){
|
||||
getchar();
|
||||
_daemon(0, 0);
|
||||
getchar();
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue