bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#9102: "timeout 0 FOO" should timeout right away


From: Pádraig Brady
Subject: bug#9102: "timeout 0 FOO" should timeout right away
Date: Sun, 17 Jul 2011 13:31:27 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3

On 16/07/11 20:34, Paul Eggert wrote:
> "sleep 0" sleeps for zero seconds, and "timeout 0 FOO"
> should timeout in zero seconds as well.  Currently,
> it doesn't; it times out in an infinite number of seconds.
> I see why, from the internals (alarm (0) is a special
> call intended to cancel alarms).  However, 'timeout' shouldn't
> be exposing those internals to users; it should behave like
> 'sleep' does, as that's more consistent.

Well my reasoning for having "0" mean don't timeout,
was to have an easy way in scripts to specify no timeout, like:

timeout=0 # none
[ "$platform" = "buggy" ] && timeout=10
timeout $timeout command

I'm unsure whether to make this change.
If we do I guess `timeout` should immediately exit(124).
This change in behavior would need a mention in NEWS anyway.

cheers,
Pádraig.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]