aboutsummaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2009-04-29 23:22:56 +0200
committerJunio C Hamano <gitster@pobox.com>2009-04-29 18:37:41 -0700
commit691f1a28bf57618d8b44a193b1d28013c858aba6 (patch)
tree7d404656089320d486f658d3f4c061cd13dff556 /unpack-trees.c
parentfc71db39e0d75e8a403f36f3fecf4450886cd165 (diff)
downloadgit-691f1a28bf57618d8b44a193b1d28013c858aba6.tar.gz
git-691f1a28bf57618d8b44a193b1d28013c858aba6.tar.xz
replace direct calls to unlink(2) with unlink_or_warn
This helps to notice when something's going wrong, especially on systems which lock open files. I used the following criteria when selecting the code for replacement: - it was already printing a warning for the unlink failures - it is in a function which already printing something or is called from such a function - it is in a static function, returning void and the function is only called from a builtin main function (cmd_) - it is in a function which handles emergency exit (signal handlers) - it is in a function which is obvously cleaning up the lockfiles Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index e4eb8fa3a..aaacaf101 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -61,7 +61,7 @@ static void unlink_entry(struct cache_entry *ce)
{
if (has_symlink_or_noent_leading_path(ce->name, ce_namelen(ce)))
return;
- if (unlink(ce->name))
+ if (unlink_or_warn(ce->name))
return;
schedule_dir_for_removal(ce->name, ce_namelen(ce));
}