diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-08-04 21:30:47 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-08-04 21:30:47 +0400 |
commit | d2dbc0b85eccd5989286c063b94f78f18992d3df (patch) | |
tree | 6f731bc07b271fba8922d3fce61e3fdc462eacda /source/blender/blenloader/intern/runtime.c | |
parent | aa43a978c187e6f9e941279f7393cdc2eb399212 (diff) |
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.
Diffstat (limited to 'source/blender/blenloader/intern/runtime.c')
-rw-r--r-- | source/blender/blenloader/intern/runtime.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/runtime.c b/source/blender/blenloader/intern/runtime.c index d6fd2f92443..ca9f2faf998 100644 --- a/source/blender/blenloader/intern/runtime.c +++ b/source/blender/blenloader/intern/runtime.c @@ -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; } |