Question about TIMEOUT applet.

Harald Becker ralda at gmx.de
Mon Jul 15 21:25:53 UTC 2013


Hi Denys !

>> > (at least newer) coreutils package contain a TIMEOUT command
>> > with a slightly different syntax then Busybox. Is this
>> > intentional or a bug? What about upstream compatibility?
>> 
>> No, it is not intended. This needs to be fixed.
>
>It seems to me the safest fix would be to keep the -t option,
>and only interpret the first non-option argument as the timeout
>value if the -t option was not specified on the command line.
>This would make the busybox version accept both its old syntax
>and the coreutils syntax.

I stated looking into this and found it would be best to create a
libbb function to get a DURATION argument with possible suffixes.
This can also be used for the sleep applet.

The libbb function shall depend on CONFIG_FEATURE_FANCY_SLEEP to
enable usage of suffixes (else only seconds), and on
CONFIG_FEATURE_FLOAT_SLEEP to allow fractionals (else only
integers). The functions returns the given duration in a struct
timespec.

Beside this I like to move the timeout applet from
miscutils to coreutils as upstream timeout is provided in this
package.

Is this ok for you?

--
Harald


More information about the busybox mailing list