Comparison

util-src/pposix.c @ 9276:3a13c246b877

util.pposix: Do not attempt to assign to stdio variables [pedantic] Fixes build on gcc 6.4.0 See also https://stackoverflow.com/a/586416
author Kim Alvefur <zash@zash.se>
date Fri, 07 Sep 2018 15:25:33 +0200
parent 9152:bad9e8b43f50
child 9277:fa6a6f921405
comparison
equal deleted inserted replaced
9275:db137a87511b 9276:3a13c246b877
109 lua_pushstring(L, "setsid-failed"); 109 lua_pushstring(L, "setsid-failed");
110 return 2; 110 return 2;
111 } 111 }
112 112
113 /* Make sure accidental use of FDs 0, 1, 2 don't cause weirdness */ 113 /* Make sure accidental use of FDs 0, 1, 2 don't cause weirdness */
114 stdin = freopen("/dev/null", "r", stdin); 114 freopen("/dev/null", "r", stdin);
115 stdout = freopen("/dev/null", "w", stdout); 115 freopen("/dev/null", "w", stdout);
116 stderr = freopen("/dev/null", "w", stderr); 116 freopen("/dev/null", "w", stderr);
117 117
118 /* Final fork, use it wisely */ 118 /* Final fork, use it wisely */
119 if(fork()) { 119 if(fork()) {
120 exit(0); 120 exit(0);
121 } 121 }