util.pposix: Do not attempt to assign to stdio variables [pedantic]
authorKim Alvefur <zash@zash.se>
Fri, 07 Sep 2018 15:25:33 +0200
changeset 9279 3a13c246b877
parent 9278 db137a87511b
child 9280 fa6a6f921405
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
util-src/pposix.c
--- a/util-src/pposix.c	Fri Sep 07 10:46:30 2018 +0100
+++ b/util-src/pposix.c	Fri Sep 07 15:25:33 2018 +0200
@@ -111,9 +111,9 @@
 	}
 
 	/* Make sure accidental use of FDs 0, 1, 2 don't cause weirdness */
-	stdin = freopen("/dev/null", "r", stdin);
-	stdout = freopen("/dev/null", "w", stdout);
-	stderr = freopen("/dev/null", "w", stderr);
+	freopen("/dev/null", "r", stdin);
+	freopen("/dev/null", "w", stdout);
+	freopen("/dev/null", "w", stderr);
 
 	/* Final fork, use it wisely */
 	if(fork()) {