dash 0.5.13.1: strange pipe behaviour
With dash 0.5.13.1 together with your latest patch I got this:
$:~> echo date | /bin/sh
$:\w> Do 30. Okt 12:21:36 CET 2025
$:\w>/bin/sh: 1: Cannot set tty process group (No such process) $:~>
with dash 0.5.12 and bash this works:
$:~> echo date | /bin/bash
Do 30. Okt 12:22:52 CET 2025
$:~>
Greetings
Juergen
PATCH 1/1 options: Call input_init before using stdin_istty
Quoted 8 lines · [email protected] wrote:
With dash 0.5.13.1 together with your latest patch I got this:
$:~> echo date |
/bin/sh
$:\w> Do 30. Okt 12:21:36 CET 2025
$:\w>/bin/sh: 1: Cannot set tty process group (No such process) $:~>
Quoted 5 lines
with dash 0.5.12 and bash this works:
$:~> echo date |
/bin/bash
Do 30. Okt 12:22:52 CET 2025
$:~>
Oh yes, the input_init optimisation went a bit over the top:
---8<---
Call input_init before using stdin_istty as otherwise it will always be true.
src/input.c +0 -2
@@ -79,8 +79,6 @@ struct parsefile *parsefile = &basepf; /* current input file */int whichprompt;/* 1 == PS1, 2 == PS2 */ int stdin_istty =-1 ; -MKINIT void input_init(void); - STATIC void pushfile(void);static void popstring (void );static int preadfd (void );
src/input.h +1 -0
@@ -119,6 +119,7 @@ void unwindfiles(struct parsefile *);void popallfiles (void );void flush_input (void );void reset_input (void ); +void input_init (void );static inline int input_get_lleft (struct parsefile *pf) {
src/options.c +5 -2
@@ -138,8 +138,11 @@ procargs(char **xargv)sh_error ("-c requires an argument" ); sflag =1 ; } -if (iflag ==2 && sflag ==1 && stdin_istty &&isatty (2 )) - iflag =1 ; +if (iflag ==2 && sflag ==1 ) { +input_init (); +if (stdin_istty &&isatty (2 )) + iflag =1 ; + }if (mflag ==2 ) mflag = iflag;for (i =0 ; i <NOPTS ; i++)
Signature · 3 lines
Email: Herbert Xu <[email protected]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt