mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-09 09:10:54 +00:00
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
This commit is contained in:
parent
36f3f6b25a
commit
f784b8a769
2 changed files with 6 additions and 26 deletions
|
@ -152,7 +152,11 @@ void Sys_mkdir (const char *path)
|
||||||
{
|
{
|
||||||
int rc = mkdir (path, 0777);
|
int rc = mkdir (path, 0777);
|
||||||
if (rc != 0 && errno == EEXIST)
|
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)
|
if (rc != 0)
|
||||||
{
|
{
|
||||||
rc = errno;
|
rc = errno;
|
||||||
|
@ -265,15 +269,3 @@ void Sys_SendKeyEvents (void)
|
||||||
IN_SendKeyEvents();
|
IN_SendKeyEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sys_LowFPPrecision (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Sys_HighFPPrecision (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Sys_SetFPCW (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,7 @@ void Sys_Init (void)
|
||||||
OSVERSIONINFO vinfo;
|
OSVERSIONINFO vinfo;
|
||||||
|
|
||||||
host_parms->userdir = host_parms->basedir;
|
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... */
|
* can be done if necessary, though... */
|
||||||
|
|
||||||
vinfo.dwOSVersionInfoSize = sizeof(vinfo);
|
vinfo.dwOSVersionInfoSize = sizeof(vinfo);
|
||||||
|
@ -358,15 +358,3 @@ void Sys_SendKeyEvents (void)
|
||||||
IN_SendKeyEvents();
|
IN_SendKeyEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sys_LowFPPrecision (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Sys_HighFPPrecision (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void Sys_SetFPCW (void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue