mirror of
https://github.com/Ryuzaki-MrL/savemii.git
synced 2026-08-24 03:44:00 -05:00
Handle directory errors independently
This commit is contained in:
@@ -135,10 +135,7 @@ Title* loadWiiTitles() {
|
||||
DIR* dir = NULL;
|
||||
|
||||
dir = opendir("slccmpt01:/title/00010000");
|
||||
if (dir == NULL) {
|
||||
promptError("Failed to open directory.");
|
||||
return NULL;
|
||||
}
|
||||
if (dir == NULL) return NULL;
|
||||
|
||||
while ((dirent = readdir(dir)) != 0) {
|
||||
if(strcmp(dirent->d_name, "..")==0 || strcmp(dirent->d_name, ".")==0) continue;
|
||||
|
||||
@@ -106,10 +106,7 @@ int DumpDir(char* pPath, const char* target_path) {
|
||||
DIR* dir = NULL;
|
||||
|
||||
dir = opendir(pPath);
|
||||
if (dir == NULL) {
|
||||
promptError("Failed to open directory.");
|
||||
return -1;
|
||||
}
|
||||
if (dir == NULL) return -1;
|
||||
|
||||
CreateSubfolder(target_path);
|
||||
|
||||
@@ -173,10 +170,7 @@ int DeleteDir(char* pPath) {
|
||||
DIR* dir = NULL;
|
||||
|
||||
dir = opendir(pPath);
|
||||
if (dir == NULL) {
|
||||
promptError("Failed to open directory.");
|
||||
return -1;
|
||||
}
|
||||
if (dir == NULL) return -1;
|
||||
|
||||
while ((dirent = readdir(dir)) != 0) {
|
||||
|
||||
@@ -404,7 +398,7 @@ void wipeSavedata(Title* title, bool allusers, bool common) {
|
||||
getUserID(usrPath);
|
||||
sprintf(srcPath + offset, "/%s", usrPath);
|
||||
}
|
||||
DeleteDir(srcPath);
|
||||
if (DeleteDir(srcPath)!=0) promptError("Failed to delete savefile.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user