Removed the stupid and pointless messing with O_NDELAY.

This commit is contained in:
Marcus Sundberg 2000-01-18 20:18:35 +00:00
parent b82d8d0e9f
commit 00fa83c923

View file

@ -25,24 +25,20 @@
USA. USA.
*/ */
#include <unistd.h> #include <stdio.h>
#include <signal.h>
#include <stdlib.h> #include <stdlib.h>
#include <limits.h> #include <limits.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/stat.h>
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#include <sys/wait.h>
#include <sys/mman.h>
#include <errno.h> #include <errno.h>
#include <signal.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include "quakedef.h" #include "quakedef.h"
@ -63,28 +59,35 @@ cvar_t sys_linerefresh = {"sys_linerefresh","0"};// set for entity display
// General routines // General routines
// ======================================================================= // =======================================================================
void Sys_DebugNumber(int y, int val) { void
Sys_DebugNumber(int y, int val)
{
} }
void Sys_Quit (void) {
void
Sys_Quit(void)
{
Host_Shutdown(); Host_Shutdown();
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
exit(0); exit(0);
} }
void Sys_Init(void) {
void
Sys_Init(void)
{
#if id386 #if id386
Sys_SetFPCW(); Sys_SetFPCW();
#endif #endif
} }
void Sys_Error (char *error, ...) {
void
Sys_Error(char *error, ...)
{
va_list argptr; va_list argptr;
char string[1024]; char string[1024];
// change stdin to non blocking
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY);
va_start (argptr, error); va_start (argptr, error);
vsnprintf (string, sizeof(string), error, argptr); vsnprintf (string, sizeof(string), error, argptr);
va_end (argptr); va_end (argptr);
@ -92,10 +95,12 @@ void Sys_Error (char *error, ...) {
Host_Shutdown (); Host_Shutdown ();
exit (1); exit (1);
} }
void Sys_Warn (char *warning, ...) {
void
Sys_Warn(char *warning, ...)
{
va_list argptr; va_list argptr;
char string[1024]; char string[1024];
@ -105,8 +110,10 @@ void Sys_Warn (char *warning, ...) {
fprintf(stderr, "Warning: %s", string); fprintf(stderr, "Warning: %s", string);
} }
int Sys_FileOpenRead (char *path, int *handle) {
int
Sys_FileOpenRead(char *path, int *handle)
{
int h; int h;
struct stat fileinfo; struct stat fileinfo;
@ -121,8 +128,10 @@ int Sys_FileOpenRead (char *path, int *handle) {
return fileinfo.st_size; return fileinfo.st_size;
} }
int Sys_FileOpenWrite (char *path) {
int
Sys_FileOpenWrite(char *path)
{
int handle; int handle;
umask (0); umask (0);
@ -287,13 +296,10 @@ int main (int c, char **v) {
// parms.cachedir = cachedir; // parms.cachedir = cachedir;
noconinput = COM_CheckParm("-noconinput"); noconinput = COM_CheckParm("-noconinput");
if (!noconinput)
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);
if (COM_CheckParm("-nostdout")) { if (COM_CheckParm("-nostdout")) {
nostdout = 1; nostdout = 1;
} else { } else {
fcntl(0, F_SETFL, fcntl (0, F_GETFL, 0) | O_NDELAY);
#ifdef QUAKEWORLD #ifdef QUAKEWORLD
printf ("QuakeForge (QW Client) v%s\n", QF_VERSION); printf ("QuakeForge (QW Client) v%s\n", QF_VERSION);
#else #else