-#ifdef FNDELAY
- fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | FNDELAY);
-#endif
+ // COMMANDLINEOPTION: sdl: -noterminal disables console output on stdout
+ if(COM_CheckParm("-noterminal"))
+ sys.outfd = -1;
+ // COMMANDLINEOPTION: sdl: -stderr moves console output to stderr
+ else if(COM_CheckParm("-stderr"))
+ sys.outfd = 2;
+ else
+ sys.outfd = 1;
+
+ fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);