Software / code / prosody
Comparison
util-src/pposix.c @ 1195:6b91a2b39680 0.4.2
Close std{in,out,err} when daemonizing
| author | Matthew Wild <mwild1@gmail.com> |
|---|---|
| date | Fri, 22 May 2009 14:48:34 +0100 |
| parent | 896:2c0b9e3c11c3 |
| child | 1565:f1eeb049a0a5 |
comparison
equal
deleted
inserted
replaced
| 1194:343f5bc5c7a7 | 1195:6b91a2b39680 |
|---|---|
| 70 lua_pushstring(L, "setsid-failed"); | 70 lua_pushstring(L, "setsid-failed"); |
| 71 return 2; | 71 return 2; |
| 72 } | 72 } |
| 73 | 73 |
| 74 /* Close stdin, stdout, stderr */ | 74 /* Close stdin, stdout, stderr */ |
| 75 /* close(0); | 75 close(0); |
| 76 close(1); | 76 close(1); |
| 77 close(2); | 77 close(2); |
| 78 */ | 78 |
| 79 /* Final fork, use it wisely */ | 79 /* Final fork, use it wisely */ |
| 80 if(fork()) | 80 if(fork()) |
| 81 exit(0); | 81 exit(0); |
| 82 | 82 |
| 83 /* Show's over, let's continue */ | 83 /* Show's over, let's continue */ |