summaryrefslogtreecommitdiff
path: root/entry.c
diff options
context:
space:
mode:
authorLuiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>2007-04-25 11:17:56 -0300
committerJunio C Hamano <junkio@cox.net>2007-04-25 13:15:27 -0700
commitcc2903fc70ea9e1bb7788a6f5f46b5d3dd1b6fe4 (patch)
tree58393d3e25a6c1e4717b36992035f5c1d9a933ec /entry.c
parentda94faf671c6b7c4db1ae07137bd93e31e232b4c (diff)
downloadgit-cc2903fc70ea9e1bb7788a6f5f46b5d3dd1b6fe4.tar.gz
remove_subtree(): Use strerror() when possible
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'entry.c')
-rw-r--r--entry.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/entry.c b/entry.c
index 84f78025ff..b51addbf8d 100644
--- a/entry.c
+++ b/entry.c
@@ -33,7 +33,7 @@ static void remove_subtree(const char *path)
char *name;
if (!dir)
- die("cannot opendir %s", path);
+ die("cannot opendir %s (%s)", path, strerror(errno));
strcpy(pathbuf, path);
name = pathbuf + strlen(path);
*name++ = '/';
@@ -45,15 +45,15 @@ static void remove_subtree(const char *path)
continue;
strcpy(name, de->d_name);
if (lstat(pathbuf, &st))
- die("cannot lstat %s", pathbuf);
+ die("cannot lstat %s (%s)", pathbuf, strerror(errno));
if (S_ISDIR(st.st_mode))
remove_subtree(pathbuf);
else if (unlink(pathbuf))
- die("cannot unlink %s", pathbuf);
+ die("cannot unlink %s (%s)", pathbuf, strerror(errno));
}
closedir(dir);
if (rmdir(path))
- die("cannot rmdir %s", path);
+ die("cannot rmdir %s (%s)", path, strerror(errno));
}
static int create_file(const char *path, unsigned int mode)