Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/rars/util/SystemIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ public static int openFile(String filename, int flags) {
FileIOData.setStreamInUse(fdToUse, inputStream); // Save stream for later use
} catch (FileNotFoundException e) {
fileErrorString = "File " + filename + " not found, open for input.";
FileIOData.close(fdToUse);
retValue = -1;
}
} else if ((flags & O_WRONLY) != 0) // Open for writing only
Expand All @@ -402,6 +403,7 @@ public static int openFile(String filename, int flags) {
FileIOData.setStreamInUse(fdToUse, outputStream); // Save stream for later use
} catch (FileNotFoundException e) {
fileErrorString = "File " + filename + " not found, open for output.";
FileIOData.close(fdToUse);
retValue = -1;
}
}
Expand Down