From f784b8a769749a14e0f754c13f23dbc3681e7c0b Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 24 Apr 2014 08:10:15 +0000 Subject: [PATCH] Unix (at least Linux) man pages for mkdir(2) document the EEXIST error: "pathname already exists (not necessarily as a directory). This includes the case where pathname is a symbolic link, dangling or not." So, add a check to see if the existing pathname is really a directory. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@901 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/sys_sdl_unix.c | 18 +++++------------- Quake/sys_sdl_win.c | 14 +------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/Quake/sys_sdl_unix.c b/Quake/sys_sdl_unix.c index fcdff11e..7c714ef6 100644 --- a/Quake/sys_sdl_unix.c +++ b/Quake/sys_sdl_unix.c @@ -152,7 +152,11 @@ void Sys_mkdir (const char *path) { int rc = mkdir (path, 0777); if (rc != 0 && errno == EEXIST) - rc = 0; + { + struct stat st; + if (stat(path, &st) == 0 && S_ISDIR(st.st_mode)) + rc = 0; + } if (rc != 0) { rc = errno; @@ -265,15 +269,3 @@ void Sys_SendKeyEvents (void) IN_SendKeyEvents(); } -void Sys_LowFPPrecision (void) -{ -} - -void Sys_HighFPPrecision (void) -{ -} - -void Sys_SetFPCW (void) -{ -} - diff --git a/Quake/sys_sdl_win.c b/Quake/sys_sdl_win.c index eb31bb14..26cf424c 100644 --- a/Quake/sys_sdl_win.c +++ b/Quake/sys_sdl_win.c @@ -153,7 +153,7 @@ void Sys_Init (void) OSVERSIONINFO vinfo; host_parms->userdir = host_parms->basedir; - /* user directories not really necessary for windows guys. + /* userdirs not really necessary for windows guys. * can be done if necessary, though... */ vinfo.dwOSVersionInfoSize = sizeof(vinfo); @@ -358,15 +358,3 @@ void Sys_SendKeyEvents (void) IN_SendKeyEvents(); } -void Sys_LowFPPrecision (void) -{ -} - -void Sys_HighFPPrecision (void) -{ -} - -void Sys_SetFPCW (void) -{ -} -