summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/cache.c
diff options
context:
space:
mode:
authorChih-Wei Huang <cwhuang@linux.org.tw>2016-11-25 12:05:07 +0800
committerChih-Wei Huang <cwhuang@linux.org.tw>2016-11-25 12:05:07 +0800
commit524121d42bfdf8c1bd3565bd2adb0ffd7b52713f (patch)
tree57b645909523126d571949a0cabb16087aca9849 /src/compiler/glsl/cache.c
parent5d0d07d402fa0edead26450fb86111292e8f834f (diff)
parentf7b58a378ca94cf1c2637d640ce5b9fb8f8519a6 (diff)
downloadexternal_mesa3d-524121d42bfdf8c1bd3565bd2adb0ffd7b52713f.zip
external_mesa3d-524121d42bfdf8c1bd3565bd2adb0ffd7b52713f.tar.gz
external_mesa3d-524121d42bfdf8c1bd3565bd2adb0ffd7b52713f.tar.bz2
Merge remote-tracking branch 'mesa/13.0' into nougat-x86
Diffstat (limited to 'src/compiler/glsl/cache.c')
-rw-r--r--src/compiler/glsl/cache.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/compiler/glsl/cache.c b/src/compiler/glsl/cache.c
index 64a34f0..db934e5 100644
--- a/src/compiler/glsl/cache.c
+++ b/src/compiler/glsl/cache.c
@@ -612,19 +612,18 @@ cache_put(struct program_cache *cache,
p_atomic_add(cache->size, size);
+ done:
+ if (fd_final != -1)
+ close(fd_final);
/* This close finally releases the flock, (now that the final dile
* has been renamed into place and the size has been added).
*/
- close(fd);
- fd = -1;
-
- done:
+ if (fd != -1)
+ close(fd);
if (filename_tmp)
ralloc_free(filename_tmp);
if (filename)
ralloc_free(filename);
- if (fd != -1)
- close(fd);
}
void *