From 109050b311090f27ffe2bfee5583a9210e4dd11d Mon Sep 17 00:00:00 2001 From: sezero 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+ssh://svn.code.sf.net/p/quakespasm/code/trunk@901 af15c1b1-3010-417e-b628-4374ebc0bcbd --- quakespasm/Quake/sys_sdl_unix.c | 18 +++++------------- quakespasm/Quake/sys_sdl_win.c | 14 +------------- 2 files changed, 6 insertions(+), 26 deletions(-) diff --git a/quakespasm/Quake/sys_sdl_unix.c b/quakespasm/Quake/sys_sdl_unix.c index fcdff11e..7c714ef6 100644 --- a/quakespasm/Quake/sys_sdl_unix.c +++ b/quakespasm/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/quakespasm/Quake/sys_sdl_win.c b/quakespasm/Quake/sys_sdl_win.c index eb31bb14..26cf424c 100644 --- a/quakespasm/Quake/sys_sdl_win.c +++ b/quakespasm/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) -{ -} -