fix error check
This commit is contained in:
@@ -159,23 +159,20 @@ bool CreateDirectories( RString Path )
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
if( errno == EEXIST )
|
if( errno == EEXIST )
|
||||||
continue; // we expect to see this error
|
|
||||||
|
|
||||||
// XXX: This doesn't make sense. Why do we return if LOG is present here?
|
|
||||||
if( LOG )
|
|
||||||
{
|
{
|
||||||
WARN( ssprintf("Couldn't create %s: %s", curpath.c_str(), strerror(errno)) );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Make sure it's a directory. */
|
/* Make sure it's a directory. */
|
||||||
struct stat st;
|
struct stat st;
|
||||||
if( DoStat(curpath, &st) != -1 && !(st.st_mode & S_IFDIR) )
|
if( DoStat(curpath, &st) != -1 && !(st.st_mode & S_IFDIR) )
|
||||||
{
|
{
|
||||||
WARN( ssprintf("Couldn't create %s: path exists and is not a directory", curpath.c_str()) );
|
WARN( ssprintf("Couldn't create %s: path exists and is not a directory", curpath.c_str()) );
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
continue; // we expect to see this error
|
||||||
|
}
|
||||||
|
|
||||||
|
WARN( ssprintf("Couldn't create %s: %s", curpath.c_str(), strerror(errno)) );
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user