Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-04-22 10:40:17 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-04-22 10:40:17 +0400
commit551096d6fd414510c4d726d0dae2f9703cb440d9 (patch)
tree8f237e5942954d9da1bea04d69792d751dc52b77 /source/blender/blenloader/intern
parent1b523b54e680d1b0bc8c7c978f8f5cf2e5b1a64e (diff)
BLI_open: check returned value for `-1` instead of `< 0`
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/runtime.c4
-rw-r--r--source/blender/blenloader/intern/writefile.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/runtime.c b/source/blender/blenloader/intern/runtime.c
index ca9f2faf998..d6fd2f92443 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 < 0)
+ if (fd == -1)
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 < 0) {
+ if (fd == -1) {
BKE_reportf(reports, RPT_ERROR, "Unable to open '%s': %s", path, strerror(errno));
goto cleanup;
}
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index b4f7332dd1a..71e490d777e 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -3469,7 +3469,7 @@ int BLO_write_file(Main *mainvar, const char *filepath, int write_flags, ReportL
BLI_snprintf(tempname, sizeof(tempname), "%s@", filepath);
file = BLI_open(tempname, O_BINARY+O_WRONLY+O_CREAT+O_TRUNC, 0666);
- if (file < 0) {
+ if (file == -1) {
BKE_reportf(reports, RPT_ERROR, "Cannot open file %s for writing: %s", tempname, strerror(errno));
return 0;
}