git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Cristian Peraferrer <corellian.c@gmail.com>
Date
May 27, 2008, 00:11 UTC
Message-ID
<B09AB9DB-FF7F-4B4A-9080-EB455DD10A96@gmail.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
Message 1 of 1 in “Added the 'errno' on die msg when the attempt to open the COMMIT_EDITMSG file fails.”
  1. Added the 'errno' on die msg when the attempt to open the COMMIT_EDITMSG file fails.Cristian Peraferrer, May 27, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.