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

[PATCH] sha1_file.c: fix a declaration-after-statement

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Aug 6, 2015, 09:53 UTC
Message-ID
<55C32EA5.2010302@ramsay1.demon.co.uk>
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi Junio,

Sorry for this hit-n-run patch, but I'm in a hurry ... :-D Could you please squash this (or something like it) into the relevant patch; Thanks!

[I noticed this simply because I have '-Wdeclaration-after-statement' and '-Werror' (among others) set in CFLAGS (via config.mak).]

HTH

ATB, Ramsay Jones

 sha1_file.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sha1_file.c b/sha1_file.c
index 43386a8..a0af574 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1462,8 +1462,9 @@ int git_open_noatime(const char *name)
 	static int sha1_file_open_flag = O_NOATIME;
 
 	for (;;) {
+		int fd;
 		errno = 0;
-		int fd = open(name, O_RDONLY | sha1_file_open_flag);
+		fd = open(name, O_RDONLY | sha1_file_open_flag);
 		if (fd >= 0)
 			return fd;
 
-- 
2.5.0
Next: Ramsay Jones
Message 1 of 2 in “sha1_file.c: fix a declaration-after-statement”
  1. sha1_file.c: fix a declaration-after-statementRamsay Jones, Aug 6, 2015
  2. Ramsay JonesAug 6, 2015

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.