mirror of
https://github.com/fankes/termux-app.git
synced 2025-09-06 02:35:19 +08:00
Attempt to fix bootstrap installation failure that may be caused by invalid mkdirs return value
This commit is contained in:
@@ -326,9 +326,10 @@ public class FileUtils {
|
||||
if (createDirectoryIfMissing && fileType == FileType.NO_EXIST) {
|
||||
Logger.logVerbose(LOG_TAG, "Creating " + label + "directory file at path \"" + filePath + "\"");
|
||||
// Create directory and update fileType if successful, otherwise return with error
|
||||
if (file.mkdirs())
|
||||
fileType = getFileType(filePath, false);
|
||||
else
|
||||
// It "might" be possible that mkdirs returns false even though directory was created
|
||||
boolean result = file.mkdirs();
|
||||
fileType = getFileType(filePath, false);
|
||||
if (!result && fileType != FileType.DIRECTORY)
|
||||
return FileUtilsErrno.ERRNO_CREATING_FILE_FAILED.getError(label + "directory file", filePath);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user