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

Re: [PATCH] config: if mtime (or size) of the config file changed since last read, reread it

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
May 6, 2006, 23:45 UTC
Message-ID
<Pine.LNX.4.63.0605070144530.7578@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<Pine.LNX.4.63.0605070125010.6597@wbgn013.biozentrum.uni-wuerzburg.de>
Hi,
sorry: bad patch. This is needed on top.
diff --git a/config.c b/config.c
index 6765186..452b587 100644
--- a/config.c
+++ b/config.c
@@ -261,6 +261,10 @@ int git_config_from_file(config_fn_t fn,
 	config_offset = 0;
 
 	in_fd = open(filename, O_RDONLY);
+	if (in_fd < 0 && ENOENT != errno )
+		die("opening %s: %s", config_file_name,
+				strerror(errno));
+
 	fstat(in_fd, &st);
 
 	if (contents) {
@@ -288,9 +292,6 @@ int git_config_from_file(config_fn_t fn,
 	} else {
 		contents = NULL;
 		config_length = 0;
-		if (in_fd < 0 && ENOENT != errno )
-			die("opening %s: %s", config_file_name,
-					strerror(errno));
 	}
 
 	return ret;
Previous: Johannes SchindelinNext: Jan-Benedict Glaw
Message 2 of 4 in “config: if mtime (or size) of the config file changed since last read, reread it”
  1. config: if mtime (or size) of the config file changed since last read, reread itJohannes Schindelin, May 6, 2006
  2. Johannes SchindelinMay 6, 2006
  3. Jan-Benedict GlawMay 7, 2006
  4. Junio C HamanoMay 7, 2006

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.