mirror of
https://github.com/git/git
synced 2024-08-24 02:11:08 +00:00
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>
This commit is contained in:
parent
781411ed46
commit
d9e08be9d5
3
apply.c
3
apply.c
|
@ -1635,7 +1635,8 @@ static void create_one_file(const char *path, unsigned mode, const char *buf, un
|
||||||
}
|
}
|
||||||
if (errno != EEXIST)
|
if (errno != EEXIST)
|
||||||
break;
|
break;
|
||||||
}
|
++nr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
die("unable to write file %s mode %o", path, mode);
|
die("unable to write file %s mode %o", path, mode);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue