git.annexia.org
/
whenjobs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2aa7088
)
daemon: On fork, open stdin/stdout/stderr on /dev/null.
author
Richard W.M. Jones
<rjones@redhat.com>
Thu, 23 Feb 2012 17:06:32 +0000
(17:06 +0000)
committer
Richard W.M. Jones
<rjones@redhat.com>
Thu, 23 Feb 2012 17:06:51 +0000
(17:06 +0000)
daemon/whenjobsd.ml
patch
|
blob
|
history
diff --git
a/daemon/whenjobsd.ml
b/daemon/whenjobsd.ml
index
164a7e2
..
1efde6c
100644
(file)
--- a/
daemon/whenjobsd.ml
+++ b/
daemon/whenjobsd.ml
@@
-104,10
+104,13
@@
Options:
(* chdir / so we don't prevent filesystems from being unmounted. *)
chdir "/";
- (* Close file descriptors. *)
+ (* Close file descriptors
, replace with /dev/null
. *)
close stdin;
close stdout;
close stderr;
+ ignore (openfile "/dev/null" [O_RDONLY] 0);
+ ignore (openfile "/dev/null" [O_WRONLY] 0);
+ ignore (openfile "/dev/null" [O_WRONLY] 0);
(* Create a new session. *)
ignore (setsid ());