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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 10, 2021, 00:45 UTC
Message-ID
<xmqqee9xw96b.fsf@gitster.g>
In-Reply-To
<ea424e3d-6269-f50d-1a4a-643bb95cfa12@web.de>
René Scharfe <l.s.r@web.de> writes:
> 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.
Obviously correct.
$ git grep -e 'open.*0[0-7][0-7][0-7]' seen \*.c | grep -v CREAT
gives this one and another from reftable.
-- >8 --
Subject: [PATCH] fixup! reftable: implement stack, a mutable database of reftable files.
To be squashed into the said commit.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 reftable/stack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/reftable/stack.c b/reftable/stack.c
index 48e22a6c18..df5021ebf0 100644
--- a/reftable/stack.c
+++ b/reftable/stack.c
@@ -107,7 +107,7 @@ static int fd_read_lines(int fd, char ***namesp)
 
 int read_lines(const char *filename, char ***namesp)
 {
-	int fd = open(filename, O_RDONLY, 0644);
+	int fd = open(filename, O_RDONLY);
 	int err = 0;
 	if (fd < 0) {
 		if (errno == ENOENT) {
-- 
2.33.0-484-g4fa4683b52
Previous: René ScharfeNext: Han-Wen Nienhuys
Message 2 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.