bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-17 Thread Paul Eggert
On 2023-07-17 10:12, Pádraig Brady wrote: Right. In headers though, the traditional "static inline" idiom Ah, I forgot that it was in system.h. At some point we should have system.h use _GL_INLINE but that can wait.

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-17 Thread Pádraig Brady
On 17/07/2023 18:04, Paul Eggert wrote: On 2023-07-17 03:31, Pádraig Brady wrote: static inline void As a general rule, there's no need for 'static inline' in C, as nowadays compilers figure out inlining just fine for static functions and plain 'static' should be good enough. There are

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-17 Thread Paul Eggert
On 2023-07-17 03:31, Pádraig Brady wrote: static inline void As a general rule, there's no need for 'static inline' in C, as nowadays compilers figure out inlining just fine for static functions and plain 'static' should be good enough. There are exceptions but 'write_error' doesn't look

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-17 Thread Pádraig Brady
On 17/07/2023 07:35, Bernhard Voelker wrote: On 7/15/23 23:08, Pádraig Brady wrote: The attached patch-set addresses two classes of issue: 1. Doubled error messages upon write errors 2. Continued processing upon write errors (the orig problem reported). Nice work! Patch 1: > ---

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-17 Thread Bernhard Voelker
On 7/15/23 23:08, Pádraig Brady wrote: The attached patch-set addresses two classes of issue: 1. Doubled error messages upon write errors 2. Continued processing upon write errors (the orig problem reported). Nice work! Patch 1: > --- /dev/null > +++ b/tests/misc/write-errors.sh > @@ -0,0

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-15 Thread Pádraig Brady
On 09/07/2023 23:54, Pádraig Brady wrote: On 09/07/2023 20:11, Paul Eggert wrote: On 2023-07-09 07:11, Pádraig Brady wrote: Note the patch looks wrong as it would close the input always. We can fix that up easily enough anyway. If it's easy and doesn't hurt performance in the usual case,

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-09 Thread Pádraig Brady
On 09/07/2023 20:11, Paul Eggert wrote: On 2023-07-09 07:11, Pádraig Brady wrote: Note the patch looks wrong as it would close the input always. We can fix that up easily enough anyway. If it's easy and doesn't hurt performance in the usual case, that's of course fine. For my reference a

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-09 Thread Paul Eggert
On 2023-07-09 07:11, Pádraig Brady wrote: Note the patch looks wrong as it would close the input always. We can fix that up easily enough anyway. If it's easy and doesn't hurt performance in the usual case, that's of course fine. For my reference a short list of utils to check (that

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-09 Thread Pádraig Brady
On 09/07/2023 10:29, Paul Eggert wrote: On 2023-07-08 15:43, Josef Bacik wrote: A very weird bug was uncovered when using fstests with github actions. In fstests we are doing something like this od /dev/urandom | dd of=somefile bs=1M count=10 The above works fine, except in the case of github

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-09 Thread Andreas Schwab
On Jul 09 2023, Paul Eggert wrote: > Do you see the same problem if you use 'cat' rather than 'od'? If so, the > problem isn't with 'od'; it's with the environment, which is somehow set > up to ignore SIGPIPE. It shouldn't do that, as ignoring SIGPIPE breaks a > lot of programs, and 'od' would be

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-09 Thread Paul Eggert
On 2023-07-08 15:43, Josef Bacik wrote: A very weird bug was uncovered when using fstests with github actions. In fstests we are doing something like this od /dev/urandom | dd of=somefile bs=1M count=10 The above works fine, except in the case of github actions which runs this script remotely,

bug#64540: [PATCH] od: exit out on failure to write to stdout

2023-07-09 Thread Josef Bacik
A very weird bug was uncovered when using fstests with github actions. In fstests we are doing something like this od /dev/urandom | dd of=somefile bs=1M count=10 The above works fine, except in the case of github actions which runs this script remotely, capturing the output in a pipe to print