From: linux@horizon.com
To: junkio@cox.net
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Clean up file descriptors when calling hooks.
Date: 7 Dec 2005 22:24:28 -0500 [thread overview]
Message-ID: <20051208032428.8591.qmail@science.horizon.com> (raw)
> A quick question. I understand "not connected to the pushing
> connection" is desirable, but is there a reason you chose to
> leave them open to /dev/null, not close()d?
Because then the first open() in the hook will assign those fds,
confusing programs that try to use them for their traditional
purposes. fd 2 (stderr) is of particular concern.
E.g. imagine if I ran gcc -c file.c, and it assigned file.c to fd 0,
file.h to fd1, and file.o to fd 2. Then wants to print a warning
message... right into the middle of the binary. (Oversimplified
example, because gcc is actually several separate programs, but
hopefully you get the idea.)
It's just safer to leave those fds open to a null device.
next reply other threads:[~2005-12-08 3:24 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-08 3:24 linux [this message]
2005-12-08 3:29 ` [PATCH] Clean up file descriptors when calling hooks Junio C Hamano
-- strict thread matches above, loose matches on Subject: below --
2005-12-08 2:04 Daniel Barkalow
2005-12-08 2:25 ` Junio C Hamano
2005-12-08 5:33 ` Daniel Barkalow
2005-12-08 5:40 ` 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=20051208032428.8591.qmail@science.horizon.com \
--to=linux@horizon.com \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/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).