* [PATCH 1/5] remove_subtree(): Use strerror() when possible
@ 2007-04-25 14:17 Luiz Fernando N. Capitulino
0 siblings, 0 replies; only message in thread
From: Luiz Fernando N. Capitulino @ 2007-04-25 14:17 UTC (permalink / raw)
To: junkio; +Cc: Git List
Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>
---
entry.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/entry.c b/entry.c
index 84f7802..b51addb 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)
--
1.5.1.1.320.g1cf2
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2007-04-25 14:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-25 14:17 [PATCH 1/5] remove_subtree(): Use strerror() when possible Luiz Fernando N. Capitulino
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).