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:
2013-08-04 17:30:47 +00:00
parent aa43a978c1
commit d2dbc0b85e
6 changed files with 15 additions and 13 deletions

View File

@@ -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;
}