This website works better with JavaScript.
Home
Explore
Help
Register
Sign In
topisto
/
btcspy
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
double fork to daemonize
master
MEUNIER Thibaud
5 years ago
parent
ab7a7f608e
commit
92cb9bb3fa
1 changed files
with
7 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+7
-0
src/daemonize.c
+ 7
- 0
src/daemonize.c
View File
@ -62,6 +62,13 @@ void daemonize(){
setsid
(
)
;
/*
*
Double
fork
method
*/
pid
=
fork
(
)
;
if
(
pid
<
0
)
exit
(
1
)
;
if
(
pid
>
0
)
exit
(
0
)
;
for
(
i
=
getdtablesize
(
)
;
i
>
=
0
;
-
-
i
)
close
(
i
)
;
lfp
=
open
(
"
/dev/null
"
,
O_RDWR
)
;
Write
Preview
Loading…
Cancel
Save