~vcs-imports/busybox/trunk

Viewing all changes in revision 17766.

  • Committer: Denys Vlasenko
  • Author(s): Ron Yorston
  • Date: 2024-07-13 19:34:18 UTC
  • Revision ID: git-v1:e4b5ccd13bb59eaaec6aa7f22655cc469f8900a2
timeout: allow fractional seconds in timeout values

The 'timeout' applet uses parse_duration_str() to obtain its
timeout values.  The default configuration enables float durations.

However, the applet silently ignores fractional seconds.  This
results in unexpected behaviour:

   $ timeout 5.99 sleep 5.1; echo $?
   Terminated
   143

When float durations are enabled ensure that any fractional seconds
are taken into account.

function                                             old     new   delta
timeout_wait                                          44      92     +48
timeout_main                                         383     365     -18
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/1 up/down: 48/-18)             Total: 30 bytes

Signed-off-by: Ron Yorston <rmy@pobox.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: