From: Herbert Xu <herbert@gondor.apana.org.au>
To: DASH Mailing List <dash@vger.kernel.org>
Subject: [PATCH] jobs: Add comment about reset_input in forkchild
Date: Wed, 24 Jul 2024 18:26:39 +0800 [thread overview]
Message-ID: <ZqDW3_Tu63sO2umG@gondor.apana.org.au> (raw)
For background jobs where the stdin is redirected to /dev/null,
a reset_input may be needed in future. For the time being there
is no reason to do this as all possible states for stdin will work
correctly with /dev/null.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
src/jobs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/jobs.c b/src/jobs.c
index 247fab5..51e6fa1 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -904,6 +904,9 @@ static void forkchild(struct job *jp, union node *n, int mode)
if (jp->nprocs == 0) {
close(0);
sh_open(_PATH_DEVNULL, O_RDONLY, 0);
+ /* Should call reset_input here, but it's harmless
+ * for now.
+ */
}
}
if (!oldlvl && iflag) {
--
2.39.2
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
reply other threads:[~2024-07-24 10:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=ZqDW3_Tu63sO2umG@gondor.apana.org.au \
--to=herbert@gondor.apana.org.au \
--cc=dash@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