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,50 +59,61 @@ 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, ...) {
va_list argptr;
char string[1024];
// change stdin to non blocking void
fcntl (0, F_SETFL, fcntl (0, F_GETFL, 0) & ~O_NDELAY); Sys_Error(char *error, ...)
{
va_start (argptr, error); va_list argptr;
vsnprintf (string, sizeof(string), error, argptr); char string[1024];
va_end (argptr);
va_start (argptr, error);
vsnprintf (string, sizeof(string), error, argptr);
va_end (argptr);
fprintf(stderr, "Error: %s\n", string); fprintf(stderr, "Error: %s\n", string);
Host_Shutdown (); Host_Shutdown ();
exit (1); exit (1);
} }
void Sys_Warn (char *warning, ...) {
va_list argptr; void
char string[1024]; Sys_Warn(char *warning, ...)
{
va_start (argptr, warning); va_list argptr;
vsnprintf (string, sizeof(string), warning, argptr); char string[1024];
va_end (argptr);
va_start (argptr, warning);
vsnprintf (string, sizeof(string), warning, argptr);
va_end (argptr);
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,12 +128,14 @@ 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);
handle = open(path,O_RDWR | O_CREAT | O_TRUNC, 0666); handle = open(path,O_RDWR | O_CREAT | O_TRUNC, 0666);
if (handle == -1) if (handle == -1)
@ -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