static int e2fsck_update_progress(e2fsck_t ctx, int pass,
unsigned long cur, unsigned long max)
{
- char buf[80];
+ char buf[1024];
float percent;
if (pass == 0)
return 0;
if (ctx->progress_fd) {
- sprintf(buf, "%d %lu %lu\n", pass, cur, max);
+ snprintf(buf, sizeof(buf), "%d %lu %lu %s\n",
+ pass, cur, max, ctx->device_name);
write(ctx->progress_fd, buf, strlen(buf));
} else {
percent = calc_percent(&e2fsck_tbl, pass, cur, max);
argv[optind]);
fatal_error(ctx, 0);
}
+ ctx->filesystem_name = string_copy(ctx, ctx->filesystem_name, 0);
if (extended_opts)
parse_extended_opts(ctx, extended_opts);
int journal_size;
int sysval, sys_page_size = 4096;
__u32 features[3];
+ char *cp;
clear_problem_context(&pctx);
#ifdef MTRACE
sizeof(sb->s_volume_name));
}
if (ctx->device_name == 0)
- ctx->device_name = ctx->filesystem_name;
+ ctx->device_name = string_copy(ctx, ctx->filesystem_name, 0);
+ for (cp = ctx->device_name; *cp; cp++)
+ if (isspace(*cp) || *cp == ':')
+ *cp = '_';
/*
* Make sure the ext3 superblock fields are consistent.