]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Make fractional delays for top(1) work for interactive mode.
authordim <dim@FreeBSD.org>
Fri, 27 Sep 2019 20:20:21 +0000 (20:20 +0000)
committerdim <dim@FreeBSD.org>
Fri, 27 Sep 2019 20:20:21 +0000 (20:20 +0000)
commit0457e6c24dee79703b4b69d7ff039eafcec16d03
treea58cade6b18d3214174329382c672cdbb829f081
parentdb240be427dca7b5cbaecab7702cae63fe20ea86
Make fractional delays for top(1) work for interactive mode.

In r334906, the -s option was changed to allow fractional times, but
this only functioned correctly for batch mode.  In interactive mode, any
delay below 1.0 would get floored to zero.  This would put top(1) into a
tight loop, which could be difficult to interrupt.

Fix this by storing the -s option value (after validation) into a struct
timeval, and using that struct consistently for delaying with select(2).

Next up is to allow interactive entry of a fractional delay value.

MFC after: 3 days
usr.bin/top/top.1
usr.bin/top/top.c