Changeset View
Changeset View
Standalone View
Standalone View
cddl/contrib/opensolaris/cmd/zfs/zfs_main.c
| Show First 20 Lines • Show All 6,109 Lines • ▼ Show 20 Lines | |||||
| */ | */ | ||||
| static void | static void | ||||
| report_mount_progress(int current, int total) | report_mount_progress(int current, int total) | ||||
| { | { | ||||
| static time_t last_progress_time = 0; | static time_t last_progress_time = 0; | ||||
| time_t now = time(NULL); | time_t now = time(NULL); | ||||
| char info[32]; | char info[32]; | ||||
| /* report 1..n instead of 0..n-1 */ | |||||
| ++current; | |||||
| /* display header if we're here for the first time */ | /* display header if we're here for the first time */ | ||||
| if (current == 1) { | if (current == 1) { | ||||
| set_progress_header(gettext("Mounting ZFS filesystems")); | set_progress_header(gettext("Mounting ZFS filesystems")); | ||||
| } else if (current != total && last_progress_time + MOUNT_TIME >= now) { | } else if (current != total && last_progress_time + MOUNT_TIME >= now) { | ||||
| /* too soon to report again */ | /* too soon to report again */ | ||||
| return; | return; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,406 Lines • Show Last 20 Lines | |||||