diff --git a/starboard/common/file.cc b/starboard/common/file.cc index 7729e9971259..9cb288ccb652 100644 --- a/starboard/common/file.cc +++ b/starboard/common/file.cc @@ -86,11 +86,9 @@ bool SbFileDeleteRecursive(const char* path, bool preserve_root) { // The |path| points to a file. Remove it and return. if (err != kSbFileOk) { - return SbFileDelete(path); + return (unlink(path) == 0); } - SbFileInfo info; - std::vector entry(kSbFileMaxName); while (SbDirectoryGetNext(dir, entry.data(), kSbFileMaxName)) { @@ -110,7 +108,7 @@ bool SbFileDeleteRecursive(const char* path, bool preserve_root) { // Don't forget to close and remove the directory before returning! if (DirectoryCloseLogFailure(path, dir)) { - return preserve_root ? true : SbFileDelete(path); + return preserve_root ? true : (rmdir(path) == 0); } return false; } diff --git a/starboard/loader_app/drain_file.cc b/starboard/loader_app/drain_file.cc index f172522c4f40..153553ee65ea 100644 --- a/starboard/loader_app/drain_file.cc +++ b/starboard/loader_app/drain_file.cc @@ -177,7 +177,7 @@ bool TryDrain(const char* dir, const char* app_key) { path.append(filename); SbFileError error = kSbFileOk; - int file = open(path.c_str(), O_CREAT | O_WRONLY); + int file = open(path.c_str(), O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR); SB_DCHECK(file >= 0); SB_DCHECK(close(file));