I don't know why we get away with this on Linux, but macOS really
means business with the "values of objects of automatic storage
invocation duration that do not have the volatile type and have
been changed between the setjmp() invocation and longjmp() call are
indeterminate" thing, leading to bad fds and a bad pid. Using
volatile causes lots of warnings about passing `volatile int*`
instead of `int*`, so it's a smaller change to move the fields into
TT (and avoid the "automatic storage" part) than it is to add the
`volatile` modifier.

Four timeout tests fail on macOS (both locally and on github's CI)
without this patch, and all timeout tests pass on macOS with this
patch.
---
 toys/other/timeout.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

Attachment: 0001-timeout.c-fix-for-macOS.patch
Description: Binary data

_______________________________________________
Toybox mailing list
Toybox@lists.landley.net
http://lists.landley.net/listinfo.cgi/toybox-landley.net

Reply via email to