summaryrefslogtreecommitdiff
path: root/source/sys_unix.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-04-23 15:02:41 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-04-23 15:02:41 +0000
commit49e6170b49fbb933eddec6d0e3f946320c68832f (patch)
tree88d228d6f89103710074fdba041ce80584d5caa6 /source/sys_unix.c
parent8c795585fb0c6c9178d9981f6943da04b7279205 (diff)
Added `dumpents' server command.
Added support for `cl_noskins' value of 2 (default all female skins to `female/athena', all male skins to `male/grunt'). Renamed `scoreshot' command to `aashot', added `aadump' command. Fixed several alignment issues on ARM architecture. Server browser menu now indicates full and password protected servers with color codes. Implemented history search in console with Ctrl+R, Ctrl+S. Removed `cl_railtrail_alpha' variable, all `cl_rail*_color' variables now accept colors in #RRGGBBAA format. Added `map_override' cvar (enables loading map entity lump from external maps/*.ent file). Made `quit' command accept extra arguments. Made `draw' command accept arbitrary colors in #RRGGBBAA format. Fixed debian packages.
Diffstat (limited to 'source/sys_unix.c')
-rw-r--r--source/sys_unix.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/source/sys_unix.c b/source/sys_unix.c
index 2f48063..293f2ca 100644
--- a/source/sys_unix.c
+++ b/source/sys_unix.c
@@ -73,8 +73,6 @@ static struct termios tty_orig;
static commandPrompt_t tty_prompt;
static int tty_hidden;
-void Sys_Printf( const char *fmt, ... );
-
/*
===============================================================================
@@ -150,6 +148,8 @@ static void Sys_InitTTY( void ) {
#endif
tty_prompt.printf = Sys_Printf;
tty_enabled = qtrue;
+
+ Sys_ConsoleWrite( " ", 1 );
}
static void Sys_ShutdownTTY( void ) {
@@ -727,19 +727,17 @@ void Sys_AddDefaultConfig( void ) {
struct stat st;
char *text;
- if( stat( DEFCFG, &st ) == -1 ) {
- return;
- }
-
fp = fopen( DEFCFG, "r" );
if( !fp ) {
return;
}
- Com_Printf( "Execing " DEFCFG "\n" );
- text = Cbuf_Alloc( &cmd_buffer, st.st_size );
- if( text ) {
- fread( text, st.st_size, 1, fp );
+ if( fstat( fileno( fp ), &st ) == 0 ) {
+ text = Cbuf_Alloc( &cmd_buffer, st.st_size );
+ if( text ) {
+ Com_Printf( "Execing " DEFCFG "\n" );
+ fread( text, st.st_size, 1, fp );
+ }
}
fclose( fp );
@@ -748,8 +746,8 @@ void Sys_AddDefaultConfig( void ) {
void Sys_Sleep( int msec ) {
struct timespec req;
- req.tv_sec = msec / 1000; msec %= 1000;
- req.tv_nsec = msec * 1000000;
+ req.tv_sec = msec / 1000;
+ req.tv_nsec = ( msec % 1000 ) * 1000000;
nanosleep( &req, NULL );
}