summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/sys_main.c10
-rw-r--r--src/sys/sys_unix.c4
-rw-r--r--src/sys/sys_win32.c11
3 files changed, 20 insertions, 5 deletions
diff --git a/src/sys/sys_main.c b/src/sys/sys_main.c
index 53084846..34367ce4 100644
--- a/src/sys/sys_main.c
+++ b/src/sys/sys_main.c
@@ -275,10 +275,12 @@ cpuFeatures_t Sys_GetProcessorFeatures( void )
cpuFeatures_t features = 0;
#ifndef DEDICATED
- if( SDL_HasRDTSC( ) ) features |= CF_RDTSC;
- if( SDL_HasMMX( ) ) features |= CF_MMX;
- if( SDL_HasSSE( ) ) features |= CF_SSE;
- if( SDL_HasSSE2( ) ) features |= CF_SSE2;
+ if( SDL_HasRDTSC( ) ) features |= CF_RDTSC;
+ if( SDL_Has3DNow( ) ) features |= CF_3DNOW;
+ if( SDL_HasMMX( ) ) features |= CF_MMX;
+ if( SDL_HasSSE( ) ) features |= CF_SSE;
+ if( SDL_HasSSE2( ) ) features |= CF_SSE2;
+ if( SDL_HasAltiVec( ) ) features |= CF_ALTIVEC;
#endif
return features;
diff --git a/src/sys/sys_unix.c b/src/sys/sys_unix.c
index 4e6b1ebf..22af0fcf 100644
--- a/src/sys/sys_unix.c
+++ b/src/sys/sys_unix.c
@@ -116,6 +116,8 @@ qboolean Sys_RandomBytes( byte *string, int len )
if( !fp )
return qfalse;
+ setvbuf( fp, NULL, _IONBF, 0 ); // don't buffer reads from /dev/urandom
+
if( fread( string, sizeof( byte ), len, fp ) != len )
{
fclose( fp );
@@ -806,7 +808,7 @@ void Sys_PlatformInit( void )
signal( SIGHUP, Sys_SigHandler );
signal( SIGQUIT, Sys_SigHandler );
signal( SIGTRAP, Sys_SigHandler );
- signal( SIGIOT, Sys_SigHandler );
+ signal( SIGABRT, Sys_SigHandler );
signal( SIGBUS, Sys_SigHandler );
Sys_SetFloatEnv();
diff --git a/src/sys/sys_win32.c b/src/sys/sys_win32.c
index a2554b89..d8e589b0 100644
--- a/src/sys/sys_win32.c
+++ b/src/sys/sys_win32.c
@@ -412,6 +412,7 @@ char **Sys_ListFiles( const char *directory, const char *extension, char *filter
intptr_t findhandle;
int flag;
int i;
+ int extLen;
if (filter) {
@@ -445,6 +446,8 @@ char **Sys_ListFiles( const char *directory, const char *extension, char *filter
flag = _A_SUBDIR;
}
+ extLen = strlen( extension );
+
Com_sprintf( search, sizeof(search), "%s\\*%s", directory, extension );
// search
@@ -458,6 +461,14 @@ char **Sys_ListFiles( const char *directory, const char *extension, char *filter
do {
if ( (!wantsubs && flag ^ ( findinfo.attrib & _A_SUBDIR )) || (wantsubs && findinfo.attrib & _A_SUBDIR) ) {
+ if (*extension) {
+ if ( strlen( findinfo.name ) < extLen ||
+ Q_stricmp(
+ findinfo.name + strlen( findinfo.name ) - extLen,
+ extension ) ) {
+ continue; // didn't match
+ }
+ }
if ( nfiles == MAX_FOUND_FILES - 1 ) {
break;
}