diff options
author | Mickaƫl Thomas <mickael9@gmail.com> | 2017-02-02 17:55:39 +0000 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2017-02-03 00:10:44 +0100 |
commit | 5216754b1ecefbf7ae0f8c1f41f5522bcdfbd517 (patch) | |
tree | 46090df9838ea55037d28877e7a5de02d8d1bc26 /clients/nm-online.c | |
parent | 660bb1a48f78cafb280e72c00c1bf0ea818f1538 (diff) | |
download | NetworkManager-5216754b1ecefbf7ae0f8c1f41f5522bcdfbd517.tar.gz |
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
Diffstat (limited to 'clients/nm-online.c')
-rw-r--r-- | clients/nm-online.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clients/nm-online.c b/clients/nm-online.c index 8ad52e9e97..bb7da015c3 100644 --- a/clients/nm-online.c +++ b/clients/nm-online.c @@ -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); |