aboutsummaryrefslogtreecommitdiff
path: root/cache.c
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
Diffstat (limited to 'cache.c')
-rw-r--r--cache.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/cache.c b/cache.c
index b169d20..57c8918 100644
--- a/cache.c
+++ b/cache.c
@@ -215,25 +215,19 @@ static int fill_slot(struct cache_slot *slot)
return errno;
/* Redirect stdout to lockfile */
- if (dup2(slot->lock_fd, STDOUT_FILENO) == -1) {
- close(tmp);
+ if (dup2(slot->lock_fd, STDOUT_FILENO) == -1)
return errno;
- }
/* Generate cache content */
slot->fn();
/* update stat info */
- if (fstat(slot->lock_fd, &slot->cache_st)) {
- close(tmp);
+ if (fstat(slot->lock_fd, &slot->cache_st))
return errno;
- }
/* Restore stdout */
- if (dup2(tmp, STDOUT_FILENO) == -1) {
- close(tmp);
+ if (dup2(tmp, STDOUT_FILENO) == -1)
return errno;
- }
/* Close the temporary filedescriptor */
if (close(tmp))