git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Luiz Fernando N. Capitulino" <lcapitulino@mandriva.com.br>
To: junkio@cox.net
Cc: Git List <git@vger.kernel.org>
Subject: [PATCH 1/5] remove_subtree(): Use strerror() when possible
Date: Wed, 25 Apr 2007 11:17:56 -0300	[thread overview]
Message-ID: <20070425111756.2fb2e870@localhost> (raw)

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

                 reply	other threads:[~2007-04-25 14:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070425111756.2fb2e870@localhost \
    --to=lcapitulino@mandriva.com.br \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).