git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12786
d7cf8633-e32d-0410-b094-
e92efae38249
// =======================================================================
void Sys_Shutdown (void)
{
// =======================================================================
void Sys_Shutdown (void)
{
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
char string[MAX_INPUTLINE];
// change stdin to non blocking
char string[MAX_INPUTLINE];
// change stdin to non blocking
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
va_start (argptr,error);
dpvsnprintf (string, sizeof (string), error, argptr);
va_end (argptr);
va_start (argptr,error);
dpvsnprintf (string, sizeof (string), error, argptr);
va_end (argptr);
// BUG: for some reason, NDELAY also affects stdout (1) when used on stdin (0).
// this is because both go to /dev/tty by default!
{
// BUG: for some reason, NDELAY also affects stdout (1) when used on stdin (0).
// this is because both go to /dev/tty by default!
{
int origflags = fcntl (sys.outfd, F_GETFL, 0);
fcntl (sys.outfd, F_SETFL, origflags & ~O_NDELAY);
int origflags = fcntl (sys.outfd, F_GETFL, 0);
fcntl (sys.outfd, F_SETFL, origflags & ~O_NDELAY);
#define write _write
#endif
while(*text)
#define write _write
#endif
while(*text)
break; // sorry, I cannot do anything about this error - without an output
text += written;
}
break; // sorry, I cannot do anything about this error - without an output
text += written;
}
fcntl (sys.outfd, F_SETFL, origflags);
fcntl (sys.outfd, F_SETFL, origflags);
}
//fprintf(stdout, "%s", text);
}
}
//fprintf(stdout, "%s", text);
}
sys.outfd = 2;
else
sys.outfd = 1;
sys.outfd = 2;
else
sys.outfd = 1;
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);