Bug 155374 - [patch] grdc(6) timing loop still broken
Summary: [patch] grdc(6) timing loop still broken
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 8.2-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-08 12:40 UTC by Andy Farkas
Modified: 2018-05-21 00:02 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (1.96 KB, patch)
2011-03-08 12:40 UTC, Andy Farkas
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andy Farkas 2011-03-08 12:40:09 UTC
After adding a small delay loop to the scrolling code of grdc(6) I noticed
that it was not keeping time properly.

This patch adds a delay during scrolling so that you can actually see it,
and also corrects the timing calculations within the do() loop.

The scrolling bit is trivial, see my followup to bin/151663.

The main thrust of this patch is to finally fix the timing of the do() loop:

1/ at the start of the loop we get the current time (now).
2/ we diplay the time, which may take some time, especially if scrolling.
3/ after display we get the time again (delay).
4/ we then calculate the amount of time needed to wait until a whole second has passed (wait).

Fix: patch (including scrolling patch):

%%%
How-To-Repeat: Add a delay during scrolling and notice how the time is displayed wrong.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2018-05-20 23:59:46 UTC
For bugs matching the following conditions:
- Status == In Progress
- Assignee == "bugs@FreeBSD.org"
- Last Modified Year <= 2017

Do
- Set Status to "Open"