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

[PATCH] improve error message in config.c

From
Alex Riesen <raa.lkml@gmail.com>
Date
Apr 29, 2009, 21:27 UTC
Message-ID
<20090429212754.GB12981@blimp.localdomain>
Show errno if opening a lockfile fails.
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

I miss them error codes greately. Especially when a problem is hard to reproduce.

 config.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/config.c b/config.c
index 1750cfb..8bd953c 100644
--- a/config.c
+++ b/config.c
@@ -996,7 +996,7 @@ int git_config_set_multivar(const char* key, const char* value,
 	lock = xcalloc(sizeof(struct lock_file), 1);
 	fd = hold_lock_file_for_update(lock, config_filename, 0);
 	if (fd < 0) {
-		error("could not lock config file %s", config_filename);
+		error("could not lock config file %s: %s", config_filename, strerror(errno));
 		free(store.key);
 		ret = -1;
 		goto out_free;
-- 
1.6.3.rc3.39.g49fd5
Message 1 of 1 in “improve error message in config.c”
  1. improve error message in config.cAlex Riesen, Apr 29, 2009

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.