diff mbox series

jobs: Add comment about reset_input in forkchild

Message ID ZqDW3_Tu63sO2umG@gondor.apana.org.au (mailing list archive)
State Accepted
Delegated to: Herbert Xu
Headers show
Series jobs: Add comment about reset_input in forkchild | expand

Commit Message

Herbert Xu July 24, 2024, 10:26 a.m. UTC
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 mbox series

Patch

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) {