summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Alex Riesen <raa.lkml@gmail.com>2006-01-05 10:00:12 +0100
committerLibravatar Junio C Hamano <junkio@cox.net>2006-01-05 17:22:49 -0800
commitd9e08be9d5b632aed84d4ee870543babafe6614b (patch)
tree7bd5e3696d0f562d9991b76be18a0959921813ee
parenttrivial: O_EXCL makes O_TRUNC redundant (diff)
downloadtgif-d9e08be9d5b632aed84d4ee870543babafe6614b.tar.xz
fix potential deadlock in create_one_file
It can happen if the temporary file already exists (i.e. after a panic and reboot). Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r--apply.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/apply.c b/apply.c
index 9eba034e5d..c471a82e83 100644
--- a/apply.c
+++ b/apply.c
@@ -1635,7 +1635,8 @@ static void create_one_file(const char *path, unsigned mode, const char *buf, un
}
if (errno != EEXIST)
break;
- }
+ ++nr;
+ }
}
die("unable to write file %s mode %o", path, mode);
}