From d2dbc0b85eccd5989286c063b94f78f18992d3df Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 4 Aug 2013 17:30:47 +0000 Subject: 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. --- source/blender/blenloader/intern/runtime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenloader/intern/runtime.c') 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; } -- cgit v1.2.3