From be88907616755a25bcc818b2983b1a9c56179744 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 13 Feb 2004 22:23:07 +0000 Subject: [PATCH] Don't warn on mkdir returning ENOENT. Don't keep trying to create directories when a component fails. We did this before because mkdir(I:\) would fail, but we don't try to create that component anymore. (This would flood the log with extranneous warnings.) --- stepmania/src/RageFileDriverDirectHelpers.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/stepmania/src/RageFileDriverDirectHelpers.cpp b/stepmania/src/RageFileDriverDirectHelpers.cpp index 8f347bc677..ffafcf0187 100644 --- a/stepmania/src/RageFileDriverDirectHelpers.cpp +++ b/stepmania/src/RageFileDriverDirectHelpers.cpp @@ -181,17 +181,24 @@ bool CreateDirectories( CString Path ) } #endif + if(LOG)LOG->Trace("mkdir %s", curpath.c_str()); if( DoMkdir(curpath, 0755) == 0 ) continue; - if(errno == EEXIST) - continue; // we expect to see this error - - // Log the error, but continue on. /* When creating a directory that already exists over Samba, Windows is * returning ENOENT instead of EEXIST. */ - if( LOG ) + /* I can't reproduce this anymore. If we get ENOENT, log it but keep + * going. */ + if( errno == ENOENT && LOG ) LOG->Warn("Couldn't create %s: %s", curpath.c_str(), strerror(errno) ); + if( errno == EEXIST || errno == ENOENT ) + continue; // we expect to see these errors + + if( LOG ) + { + LOG->Warn("Couldn't create %s: %s", curpath.c_str(), strerror(errno) ); + return false; + } /* Make sure it's a directory. */ struct stat st;