# [PATCH] Added the 'errno' on die msg when the attempt to open the COMMIT_EDITMSG file fails.

1 messages from 2008-05-27 to 2008-05-27. Participants: Cristian Peraferrer.
Thread: https://gitlist.dev/t/13678

## Cristian Peraferrer, 2008-05-27 00:11

Subject: [PATCH] Added the 'errno' on die msg when the attempt to open the COMMIT_EDITMSG file fails.
Message-ID: <B09AB9DB-FF7F-4B4A-9080-EB455DD10A96@gmail.com>
URL: https://gitlist.dev/e/B09AB9DB-FF7F-4B4A-9080-EB455DD10A96%40gmail.com

```
I have added the strerror(errno) in the die message when the attempt
to open the COMMIT_EDITMSG file fails.

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

diff --git a/builtin-commit.c b/builtin-commit.c
index 07872c8..014a406 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -500,7 +500,7 @@ 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

```
