- va_list argptr;
- char string[1024];
-
- va_start (argptr,warning);
- vsprintf (string,warning,argptr);
- va_end (argptr);
- fprintf(stderr, "Warning: %s", string);
-}
-
-double Sys_DoubleTime (void)
-{
- static int first = true;
- static double oldtime = 0.0, curtime = 0.0;
- double newtime;
- struct timeval tp;
-
- gettimeofday(&tp, NULL);
-
- newtime = (double) tp.tv_sec + tp.tv_usec / 1000000.0;
-
- if (first)
+ if(outfd < 0)
+ return;
+#ifdef FNDELAY
+ // BUG: for some reason, NDELAY also affects stdout (1) when used on stdin (0).
+ // this is because both go to /dev/tty by default!