mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-05 05:20:32 +01:00
nm-online: fix countdown to not show 0 seconds until finished
When using nm-online -t N, the countdown shows "0s" during the last second. The countdown value should be rounded up so that "0s" is only shown when the timeout is actually elapsed. https://bugzilla.gnome.org/show_bug.cgi?id=778093
This commit is contained in:
parent
660bb1a48f
commit
5216754b1e
1 changed files with 1 additions and 1 deletions
|
|
@ -90,7 +90,7 @@ _print_progress (int progress_next_step_i, gint64 remaining_ms, int success)
|
|||
g_print ("\r%s", _("Connecting"));
|
||||
for (i = 0; i < PROGRESS_STEPS; i++)
|
||||
putchar (i < j ? '.' : ' ');
|
||||
g_print (" %4lds", (long) (MAX (0, remaining_ms) / 1000));
|
||||
g_print (" %4lds", (long) (MAX (0, remaining_ms + 999) / 1000));
|
||||
if (success >= 0)
|
||||
g_print (" [%sline]\n", success ? "on" : "off");
|
||||
fflush (stdout);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue