All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Lars Schneider <larsxschneider@gmail.com>
Cc: git@vger.kernel.org, gitster@pobox.com, tboegi@web.de, e@80x24.org
Subject: Re: [PATCH v1 2/2] read-cache: make sure file handles are not inherited by child processes
Date: Tue, 6 Sep 2016 13:41:00 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1609061339230.129229@virtualbox> (raw)
In-Reply-To: <20160905211111.72956-3-larsxschneider@gmail.com>

Hi Lars,

On Mon, 5 Sep 2016, larsxschneider@gmail.com wrote:

> [... commit message ...]

Makes sense.

> diff --git a/read-cache.c b/read-cache.c
> index 491e52d..02f74d3 100644
> --- a/read-cache.c
> +++ b/read-cache.c
> @@ -156,7 +156,7 @@ void fill_stat_cache_info(struct cache_entry *ce, struct stat *st)
>  static int ce_compare_data(const struct cache_entry *ce, struct stat *st)
>  {
>  	int match = -1;
> -	int fd = open(ce->name, O_RDONLY);
> +	int fd = open(ce->name, O_RDONLY | O_CLOEXEC);

Eric's comment on 1/2 applies here, too, of course: should this cause any
problems on non-Windows platforms, we always have that FD_CLOEXEC thing
that we could probably use to fix it.

But let's cross that bridge when (or better: if) we get there.

Ciao,
Dscho

  reply	other threads:[~2016-09-06 11:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-05 21:11 [PATCH v1 0/2] Use CLOEXEC to avoid fd leaks larsxschneider
2016-09-05 21:11 ` [PATCH v1 1/2] sha1_file: open window into packfiles with CLOEXEC larsxschneider
2016-09-05 22:27   ` Eric Wong
2016-09-06  9:36     ` Jakub Narębski
2016-09-06 11:38     ` Johannes Schindelin
2016-09-07 13:20       ` Lars Schneider
2016-09-07 18:17         ` Eric Wong
2016-09-05 21:11 ` [PATCH v1 2/2] read-cache: make sure file handles are not inherited by child processes larsxschneider
2016-09-06 11:41   ` Johannes Schindelin [this message]
2016-09-06 21:06   ` Eric Wong
2016-09-07 13:39     ` Lars Schneider
2016-09-07 18:10       ` Eric Wong
2016-09-07 18:23         ` Junio C Hamano
2016-09-08  5:57           ` Lars Schneider
2016-09-08 17:37             ` 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=alpine.DEB.2.20.1609061339230.129229@virtualbox \
    --to=johannes.schindelin@gmx.de \
    --cc=e@80x24.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=larsxschneider@gmail.com \
    --cc=tboegi@web.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.