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

2023-01-03 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 v3 2/3] script(1): simplify shell execution

2023-01-03 Thread наб
Use execl in both paths and the same warn() call --- Resend after a year; clean rebase. Keep me in CC. 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

[PATCH v3 3/3] script(1): fix exit status wording

2023-01-03 Thread наб
--- Resend after a year; clean rebase. Keep me in CC. Failure-of-script status unchanged at 1 after complaints for v2. usr.bin/script/script.1 | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.bin/script/script.1 b/usr.bin/script/script.1 index aa8bb2790..aa55d43af

Re: [PATCH] Correctly (per POSIX) round up df usage percentage

2022-12-31 Thread наб
Hi! Ran into this /again/ in my CI environment; I've validated, again, that this patch applies to current git, and that it applies the rounding correctly. Best, On Mon, Aug 29, 2022 at 01:51:14PM +0200, наб wrote: > Subject: [PATCH] Correctly (per POSIX) round up df usage percentage > &

Re: [PATCH] Correctly (per POSIX) round up df usage percentage

2022-08-29 Thread наб
On Mon, Aug 29, 2022 at 05:10:10AM -0600, Theo de Raadt wrote: > I would really prefer if this did not need floating point. In that case, how about this scissor-patch? It has the added benefit of removing the existing floating-point usage. Best, -- >8 -- Subject: [PATCH] Correctly (per POSIX)

Re: [PATCH] Correctly (per POSIX) round up df usage percentage

2022-08-29 Thread наб
int iceil(double d) { int ret = d; if(ret < d) ++ret; return ret; } -- >8 -- since all the formatting specifiers use %.0f anyway and the [0, 200) domain is small enough that precision loss/overflow is not a factor. Best, наб signature.asc Description: PGP signature

[PATCH] Correctly (per POSIX) round up df usage percentage

2022-08-27 Thread наб
Quoth POSIX Issue 7: The percentage of the normally available space that is currently allocated to all files on the file system. This shall be calculated using the fraction: /( + ) expressed as a percentage. This percentage may be greater than 100 if is less than

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

2022-01-29 Thread наб
On Fri, Jan 28, 2022 at 06:32:07PM -0800, Philip Guenther wrote: > On Fri, Jan 28, 2022 at 5:28 AM наб > wrote: > > 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 > > utiliti

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

2022-01-28 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-28 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-28 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