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>
Alex Riesen committed
Jan 5, 2006 at 10:00 UTC
d9e08be9d5b632aed84d4ee870543babafe6614b
1 file changed
+2
-1
apply.c
+2
-1
@@ -1635,7 +1635,8 @@ static void create_one_file(const char *path, unsigned mode, const char *buf, un
1635
}
1636
if (errno != EEXIST)
1637
break;
1638
- }
1638
+ ++nr;
1639
+ }
1640
}
1641
die("unable to write file %s mode %o", path, mode);
1642
}