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

[PATCH] refs/files-backend: remove unused open mode parameter

From
René Scharfe <l.s.r@web.de>
Date
Sep 9, 2021, 21:45 UTC
Message-ID
<ea424e3d-6269-f50d-1a4a-643bb95cfa12@web.de>

We only need to provide a mode if we are willing to let open(2) create the file, which is not the case here, so drop the unnecessary parameter.

Signed-off-by: René Scharfe <l.s.r@web.de>
---
 refs/files-backend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 677b7e4cdd..74c0385873 100644
--- a/refs/files-backend.c
+++ b/refs/files-backend.c
@@ -1569,7 +1569,7 @@ static int log_ref_setup(struct files_ref_store *refs,
 			goto error;
 		}
 	} else {
-		*logfd = open(logfile, O_APPEND | O_WRONLY, 0666);
+		*logfd = open(logfile, O_APPEND | O_WRONLY);
 		if (*logfd < 0) {
 			if (errno == ENOENT || errno == EISDIR) {
 				/*
--
2.33.0
Next: Junio C Hamano
Message 1 of 5 in “refs/files-backend: remove unused open mode parameter”
  1. refs/files-backend: remove unused open mode parameterRené Scharfe, Sep 9, 2021
  2. Junio C HamanoSep 10, 2021
  3. Han-Wen NienhuysSep 13, 2021
  4. Junio C HamanoSep 13, 2021
  5. Jeff KingSep 13, 2021

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.