#include <time.h>
static char spaces[80], backspaces[80];
+static time_t last_update;
+
+struct ext2fs_progress_ops ext2fs_numeric_progress_ops = {
+ .init = ext2fs_numeric_progress_init,
+ .update = ext2fs_numeric_progress_update,
+ .close = ext2fs_numeric_progress_close,
+};
static int int_log10(unsigned int arg)
{
spaces[sizeof(spaces)-1] = 0;
memset(backspaces, '\b', sizeof(backspaces)-1);
backspaces[sizeof(backspaces)-1] = 0;
- progress->skip_progress = 0;
+
+ memset(progress, 0, sizeof(*progress));
if (getenv("E2FSPROGS_SKIP_PROGRESS"))
progress->skip_progress++;
- memset(progress, 0, sizeof(*progress));
/*
* Figure out how many digits we need
fputs(label, stdout);
fflush(stdout);
}
+ last_update = 0;
}
void ext2fs_numeric_progress_update(ext2_filsys fs,
struct ext2fs_numeric_progress_struct * progress,
__u64 val)
{
- static time_t now, last_update = 0;
+ time_t now;
if (!(fs->flags & EXT2_FLAG_PRINT_PROGRESS))
return;