diff --git a/stepmania/src/RageUtil_FileDB.cpp b/stepmania/src/RageUtil_FileDB.cpp index b24ad588f5..7d151d45bb 100644 --- a/stepmania/src/RageUtil_FileDB.cpp +++ b/stepmania/src/RageUtil_FileDB.cpp @@ -75,7 +75,12 @@ void FileSet::LoadFromDir(const CString &dir) char buf[PATH_MAX]; bool ret = getcwd(buf, PATH_MAX) != NULL; ASSERT(ret); - chdir(dir.c_str()); + if( chdir(dir.c_str()) == -1 ) + { + /* Only log once per dir. */ + LOG->MapLog("chdir " + dir, "Couldn't chdir(%s): %s", dir.c_str(), strerror(errno) ); + return; + } DIR *d = opendir("."); while(struct dirent *ent = readdir(d))