git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: pedrodelyra@gmail.com
To: git@vger.kernel.org
Cc: Pedro de Lyra <pedrodelyra@gmail.com>
Subject: [PATCH] setup.c: remove needless argument passed to open in sanitize_stdfds
Date: Sun, 25 Nov 2018 14:20:08 -0200	[thread overview]
Message-ID: <20181125162008.30065-1-pedrodelyra@gmail.com> (raw)

From: Pedro de Lyra <pedrodelyra@gmail.com>

Signed-off-by: Pedro de Lyra <pedrodelyra@gmail.com>
---
According to POSIX manual pages, the open() system call's mode argument specifies the file mode bits to be applied when a new file is created. If neither O_CREAT nor O_TMPFILE is specified, then mode is ignored. So I guess that 0 argument only confuses the reader.
 setup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup.c b/setup.c
index 1be5037f1..d4fd14bb7 100644
--- a/setup.c
+++ b/setup.c
@@ -1228,7 +1228,7 @@ const char *resolve_gitdir_gently(const char *suspect, int *return_error_code)
 /* if any standard file descriptor is missing open it to /dev/null */
 void sanitize_stdfds(void)
 {
-	int fd = open("/dev/null", O_RDWR, 0);
+	int fd = open("/dev/null", O_RDWR);
 	while (fd != -1 && fd < 2)
 		fd = dup(fd);
 	if (fd == -1)
-- 
2.17.1


             reply	other threads:[~2018-11-25 16:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-25 16:20 pedrodelyra [this message]
2018-11-26  4:39 ` [PATCH] setup.c: remove needless argument passed to open in sanitize_stdfds Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181125162008.30065-1-pedrodelyra@gmail.com \
    --to=pedrodelyra@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).