more consistent use of checks of BLI_open(), check 'fd < 0' rather then -1. packedfile incorrectly treated 0 as an error value. best not be vague/sloppy with this.
This commit is contained in:
@@ -72,7 +72,7 @@ int BLO_is_a_runtime(const char *path)
|
||||
int datastart;
|
||||
char buf[8];
|
||||
|
||||
if (fd == -1)
|
||||
if (fd < 0)
|
||||
goto cleanup;
|
||||
|
||||
lseek(fd, -12, SEEK_END);
|
||||
@@ -104,7 +104,7 @@ BlendFileData *BLO_read_runtime(const char *path, ReportList *reports)
|
||||
|
||||
fd = BLI_open(path, O_BINARY | O_RDONLY, 0);
|
||||
|
||||
if (fd == -1) {
|
||||
if (fd < 0) {
|
||||
BKE_reportf(reports, RPT_ERROR, "Unable to open '%s': %s", path, strerror(errno));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user