[PATCH v2 3/3] script(1): fix exit status wording, use 125 for general failure

2022-01-12 Thread наб
This is a base-line attempt at separating errors from the child from the ones from script itself ‒ 125 is the general-purpose code in POSIX utilities that exec() (with 126 being ENOEXEC and 127 ‒ ENOENT) --- Please keep me in CC, as I'm not subscribed. usr.bin/script/script.1 | 6 ++

[PATCH v2 2/3] script(1): simplify shell execution

2022-01-12 Thread наб
Use execl in both paths and the same warn() call --- Please keep me in CC, as I'm not subscribed. usr.bin/script/script.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 763975d6a..fd2829033 100644 ---

[PATCH v2 1/3] script(1): actually bubble child errors

2022-01-12 Thread наб
script.1 says > script will exit with the status of 0 unless any of its child > processes fail, in which case, script will return 1. This is a patent lie: it only exits with 1 if the host or writer processes fail, not the actual child Instead, wait for the child in the writer process and bubble

Re: [PATCH 4/4] script(1): explicitly specify sh -c

2022-01-03 Thread наб
On Sun, Jan 02, 2022 at 11:52:49PM +, Jason McIntyre wrote: > On Sun, Jan 02, 2022 at 11:47:04PM +0100, ?? wrote: > > On Sun, Jan 02, 2022 at 06:56:37PM +, Jason McIntyre wrote: > > > On Sat, Jan 01, 2022 at 11:07:49PM +0100, ?? wrote: > > > > @@ -69,8 +69,8 @@ retaining the prior

Re: [PATCH 4/4] script(1): explicitly specify sh -c

2022-01-02 Thread наб
On Sun, Jan 02, 2022 at 06:56:37PM +, Jason McIntyre wrote: > On Sat, Jan 01, 2022 at 11:07:49PM +0100, ?? wrote: > > @@ -69,8 +69,8 @@ retaining the prior contents. > > .It Fl c Ar command > > Run > > .Ar command > > +.Pq via Nm sh Fl c Ar command > > instead of an interactive shell.

[PATCH 1/4] script(1): actually bubble child errors

2022-01-01 Thread наб
script.1 says > script will exit with the status of 0 unless any of its child > processes fail, in which case, script will return 1. This is a patent lie: it only exits with 1 if the host or writer processes fail, not the actual child Instead, wait for the child in the writer process and bubble

[PATCH 2/4] script(1): simplify shell execution

2022-01-01 Thread наб
Use execl in both paths and the same warn() call --- usr.bin/script/script.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c index 763975d6a..fd2829033 100644 --- a/usr.bin/script/script.c +++

[PATCH 3/4] script(1): fix exit status wording, use 125 for general failure

2022-01-01 Thread наб
This is a base-line attempt at separating errors from the child from the ones from script itself ‒ 125 is the general-purpose code in POSIX utilities that exec() (with 126 being ENOEXEC and 127 ‒ ENOENT) --- usr.bin/script/script.1 | 6 ++ usr.bin/script/script.c | 6 +++--- 2 files changed,

[PATCH 4/4] script(1): explicitly specify sh -c

2022-01-01 Thread наб
The original wording is weird and doesn't explicitly say that it does sh -c, which is the fundamental point ‒ spell it out directly --- usr.bin/script/script.1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/script/script.1 b/usr.bin/script/script.1 index