From 8e9e81d99b09c79c4f4af73cb00f084d48750085 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 8 May 2007 03:20:40 +0000 Subject: [PATCH] fix error check --- stepmania/src/RageFileDriverDirectHelpers.cpp | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/stepmania/src/RageFileDriverDirectHelpers.cpp b/stepmania/src/RageFileDriverDirectHelpers.cpp index 16e337d209..3f9051fdcf 100644 --- a/stepmania/src/RageFileDriverDirectHelpers.cpp +++ b/stepmania/src/RageFileDriverDirectHelpers.cpp @@ -159,23 +159,20 @@ bool CreateDirectories( RString Path ) #endif if( errno == EEXIST ) + { + /* Make sure it's a directory. */ + struct stat st; + 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()) ); + return false; + } + 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. */ - struct stat st; - 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()) ); - - return false; - } + WARN( ssprintf("Couldn't create %s: %s", curpath.c_str(), strerror(errno)) ); + return false; } return true;