aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/pposix.c
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-11-11 23:48:38 +0100
committerKim Alvefur <zash@zash.se>2012-11-11 23:48:38 +0100
commit80711fd402439eb00afef9411334b72f6e615647 (patch)
tree6367ad48930ec474c7797b1f53089e0e52c684a2 /util-src/pposix.c
parentbf9a3cef1f71ed3e0b6cae0b082cb339b47ed01d (diff)
parent3e7cd680929dd2c391da21a940a4fc9e1b5663be (diff)
downloadprosody-80711fd402439eb00afef9411334b72f6e615647.tar.gz
prosody-80711fd402439eb00afef9411334b72f6e615647.zip
Merge 0.9 -> trunk
Diffstat (limited to 'util-src/pposix.c')
-rw-r--r--util-src/pposix.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/util-src/pposix.c b/util-src/pposix.c
index 191e276e..05303d99 100644
--- a/util-src/pposix.c
+++ b/util-src/pposix.c
@@ -89,6 +89,10 @@ static int lc_daemonize(lua_State *L)
close(0);
close(1);
close(2);
+ /* Make sure accidental use of FDs 0, 1, 2 don't cause weirdness */
+ open("/dev/null", O_RDONLY);
+ open("/dev/null", O_WRONLY);
+ open("/dev/null", O_WRONLY);
/* Final fork, use it wisely */
if(fork())