[PATCH] Added the printing of 'errno' error number when the attempt to open the COMMIT_EDITMSG file is failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Cristian Peraferrer <corellian.c@xxxxxxxxx>
Date: Fri, 20 Jun 2008 17:24:20 +0200
Subject: [PATCH] Added the printing of 'errno' error number when the attempt to open the COMMIT_EDITMSG file is failed

Now when the COMMIT_EDITMSG cannot be opened, the die message gives
more information to the user by giving the 'errno' number.

Signed-off-by: Cristian Peraferrer <corellian.c@xxxxxxxxx>
---
 builtin-commit.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/builtin-commit.c b/builtin-commit.c
index 90200ed..a33f43a 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -502,7 +502,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix)

 	fp = fopen(git_path(commit_editmsg), "w");
 	if (fp == NULL)
-		die("could not open %s", git_path(commit_editmsg));
+		die("could not open %s: %s",
+		    git_path(commit_editmsg), strerror(errno));

 	if (cleanup_mode != CLEANUP_NONE)
 		stripspace(&sb, 0);
--
1.5.5


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux