Closed ale5000-git closed 1 month ago
BusyBox timeout
accepts fractional times but silently truncates them to an integer value. The example above is therefore effectively:
timeout 5 sleep 5.98; echo $?
The problem is in the upstream code so any fix will need to be acceptable to them.
This also timeout:
timeout 6 sleep 5.9; echo $?
This also timeout:
timeout 6 sleep 5.9; echo $?
That one, I think, is my problem, so can be fixed without reference to upstream.
Thanks, for the other one I will report it upstream when I get some time.
I've submitted a patch upstream. I've also fixed both the problems in busybox-w32.
The precision is still a bit off:
timeout 0.99 sleep 0.96; echo $?
sometimes fails and sometimes works. It's either inaccurate timekeeping or the slow process creation on Windows (so the timeout starts 10-20ms before the sleep). Possibly both.
Try the latest prerelease binaries (PRE-5320 or later).
This works perfectly: timeout 5.99 sleep 5.95; echo $?
It seems good enough for almost all uses, thanks a lot.
This issue should be fixed in the latest release, FRP-5398.
The upstream patch has also been applied, so fractional timeouts are supported there too now.
This works fine in the online bash shell:
timeout 5.99 sleep 5.98; echo $?
but on BusyBox it timeout.I'm sure why but in the past I also get this to fail
timeout 6 sleep 5; echo $?
but now it works.