free_buf = 1;
err = ext2fs_get_arrayzero(1, blocksize, &buf);
if (err) {
- com_err(program_name, err,
+ com_err(program_name, err, "%s",
_("while allocating buffer"));
exit(1);
}
com_err(program_name, err,
_("error writing block %llu"), block);
else
- com_err(program_name, err, _("error in write()"));
+ com_err(program_name, err, "%s",
+ _("error in generic_write()"));
exit(1);
}
retval = ext2fs_get_mem(fs->blocksize, &buf);
if (retval) {
- com_err(program_name, retval, _("while allocating buffer"));
+ com_err(program_name, retval, "%s",
+ _("while allocating buffer"));
exit(1);
}
retval = ext2fs_get_memzero(fs->blocksize, &zero_buf);
if (retval) {
- com_err(program_name, retval, _("while allocating buffer"));
+ com_err(program_name, retval, "%s",
+ _("while allocating buffer"));
exit(1);
}
if (show_progress) {
- fprintf(stderr, _("Copying "));
+ fprintf(stderr, "%s", _("Copying "));
bscount = print_progress(total_written, meta_blocks_count);
fflush(stderr);
last_update = time(NULL);
if (got_sigint) {
if (distance) {
/* moving to the right */
- if (distance >= ext2fs_blocks_count(fs->super) ||
- start == ext2fs_blocks_count(fs->super) - distance)
- kill (getpid(), SIGINT);
+ if (distance >= ext2fs_blocks_count(fs->super)||
+ start == ext2fs_blocks_count(fs->super) -
+ distance)
+ kill(getpid(), SIGINT);
} else {
/* moving to the left */
- if (blk < (source_offset - dest_offset) / fs->blocksize)
- kill (getpid(), SIGINT);
+ if (blk < (source_offset - dest_offset) /
+ fs->blocksize)
+ kill(getpid(), SIGINT);
}
if (show_progress)
fputc('\r', stderr);
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("Stopping now will destroy the filesystem, "
"interrupt again if you are sure\n"));
if (show_progress) {
- fprintf(stderr, _("Copying "));
+ fprintf(stderr, "%s", _("Copying "));
bscount = print_progress(total_written,
meta_blocks_count);
fflush(stderr);
total_written) - duration;
char buff[30];
strftime(buff, 30, "%T", gmtime(&est));
- bscount += fprintf(stderr,
- _(" %s remaining at %.2f MB/s"),
- buff, calc_rate(total_written,
- fs->blocksize,
- duration));
+ bscount +=
+ fprintf(stderr,
+ _(" %s remaining at %.2f MB/s"),
+ buff, calc_rate(total_written,
+ fs->blocksize,
+ duration));
}
fflush (stderr);
}
ret = ext2fs_get_arrayzero(image->l1_size, sizeof(__u64), &l1_table);
if (ret) {
- com_err(program_name, ret, _("while allocating l1 table"));
+ com_err(program_name, ret, "%s",
+ _("while allocating l1 table"));
exit(1);
}
return;
alloc_err:
- com_err(program_name, ret, _("while allocating l2 cache"));
+ com_err(program_name, ret, "%s", _("while allocating l2 cache"));
exit(1);
}
}
if (cache->free != cache->count) {
- fprintf(stderr, _("Warning: There are still tables in the "
- "cache while putting the cache, data will "
- "be lost so the image may not be valid.\n"));
+ fprintf(stderr, "%s", _("Warning: There are still tables in "
+ "the cache while putting the cache, "
+ "data will be lost so the image may "
+ "not be valid.\n"));
table = cache->used_head;
cache->used_head = NULL;
goto again;
/* allocate struct ext2_qcow2_image */
retval = ext2fs_get_mem(sizeof(struct ext2_qcow2_image), &img);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while allocating ext2_qcow2_image"));
exit(1);
}
retval = initialize_qcow2_image(fd, fs, img);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while initializing ext2_qcow2_image"));
exit(1);
}
retval = ext2fs_get_mem(fs->blocksize, &buf);
if (retval) {
- com_err(program_name, retval, _("while allocating buffer"));
+ com_err(program_name, retval, "%s",
+ _("while allocating buffer"));
exit(1);
}
/* Write qcow2 data blocks */
* block should not be created!
*/
if (update_refcount(fd, img, offset, offset)) {
- fprintf(stderr, _("Programming error: "
- "multiple sequential refcount "
- "blocks created!\n"));
+ fprintf(stderr, "%s",
+ _("Programming error: multiple "
+ "sequential refcount blocks "
+ "created!\n"));
exit(1);
}
}
offset += img->cluster_size;
if (update_refcount(fd, img, offset,
offset)) {
- fprintf(stderr,
+ fprintf(stderr, "%s",
_("Programming error: multiple sequential refcount "
"blocks created!\n"));
exit(1);
retval = ext2fs_allocate_block_bitmap(fs, _("in-use block map"),
&meta_block_map);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while allocating block bitmap"));
exit(1);
}
retval = ext2fs_allocate_block_bitmap(fs, "scramble block map",
&scramble_block_map);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while allocating scramble block bitmap"));
exit(1);
}
mark_table_blocks(fs);
if (show_progress)
- printf(_("Scanning inodes...\n"));
+ printf("%s", _("Scanning inodes...\n"));
retval = ext2fs_open_inode_scan(fs, 0, &scan);
if (retval) {
- com_err(program_name, retval,"%s",
+ com_err(program_name, retval, "%s",
_("while opening inode scan"));
exit(1);
}
io_channel io;
if (type) {
- com_err(program_name, 0, _("Raw and qcow2 images cannot"
- "be installed"));
+ com_err(program_name, 0, "%s",
+ _("Raw and qcow2 images cannot be installed"));
exit(1);
}
retval = ext2fs_open (image_fn, open_flag, 0, 0,
io_ptr, &fs);
if (retval) {
- com_err (program_name, retval, _("while trying to open %s"),
- image_fn);
+ com_err(program_name, retval, _("while trying to open %s"),
+ image_fn);
exit(1);
}
retval = ext2fs_read_bitmaps (fs);
if (retval) {
- com_err(program_name, retval, _("error reading bitmaps"));
+ com_err(program_name, retval, "%s", _("error reading bitmaps"));
exit(1);
}
retval = io_ptr->open(device, IO_FLAG_RW, &io);
if (retval) {
- com_err(device, 0, _("while opening device file"));
+ com_err(device, 0, "%s", _("while opening device file"));
exit(1);
}
retval = ext2fs_image_inode_read(fs, fd, 0);
if (retval) {
- com_err(image_fn, 0, _("while restoring the image table"));
+ com_err(image_fn, 0, "%s",
+ _("while restoring the image table"));
exit(1);
}
usage();
if (all_data && !img_type) {
- com_err(program_name, 0, _("-a option can only be used "
- "with raw or QCOW2 images."));
+ com_err(program_name, 0, "%s", _("-a option can only be used "
+ "with raw or QCOW2 images."));
exit(1);
}
if ((source_offset || dest_offset) && img_type != E2IMAGE_RAW) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Offsets are only allowed with raw images."));
exit(1);
}
if (move_mode && img_type != E2IMAGE_RAW) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Move mode is only allowed with raw images."));
exit(1);
}
if (move_mode && !all_data) {
- com_err(program_name, 0,
+ com_err(program_name, 0, "%s",
_("Move mode requires all data mode."));
exit(1);
}
retval = ext2fs_check_if_mounted(device_name, &mount_flags);
if (retval) {
- com_err(program_name, retval, _("checking if mounted"));
+ com_err(program_name, retval, "%s", _("checking if mounted"));
exit(1);
}
if (img_type && !ignore_rw_mount &&
(mount_flags & EXT2_MF_MOUNTED) &&
!(mount_flags & EXT2_MF_READONLY)) {
- fprintf(stderr, _("\nRunning e2image on a R/W mounted "
+ fprintf(stderr, "%s", _("\nRunning e2image on a R/W mounted "
"filesystem can result in an\n"
"inconsistent image which will not be useful "
"for debugging purposes.\n"
seek_set(fd, dest_offset);
if ((img_type & E2IMAGE_QCOW2) && (fd == 1)) {
- com_err(program_name, 0, _("QCOW2 image can not be written to "
- "the stdout!\n"));
+ com_err(program_name, 0, "%s",
+ _("QCOW2 image can not be written to the stdout!\n"));
exit(1);
}
if (fd != 1) {
if (fstat(fd, &st)) {
- com_err(program_name, 0, _("Can not stat output\n"));
+ com_err(program_name, 0, "%s",
+ _("Can not stat output\n"));
exit(1);
}
if (S_ISBLK(st.st_mode))
if (check) {
if (img_type != E2IMAGE_RAW) {
- fprintf(stderr, _("The -c option only supported "
- "in raw mode\n"));
+ fprintf(stderr, "%s", _("The -c option only supported "
+ "in raw mode\n"));
exit(1);
}
if (fd == 1) {
- fprintf(stderr, _("The -c option is not supported "
- "when writing to stdout\n"));
+ fprintf(stderr, "%s", _("The -c option not supported "
+ "when writing to stdout\n"));
exit(1);
}
retval = ext2fs_get_mem(fs->blocksize, &check_buf);
if (retval) {
- com_err(program_name, retval,
+ com_err(program_name, retval, "%s",
_("while allocating check_buf"));
exit(1);
}
}
if (show_progress && (img_type != E2IMAGE_RAW)) {
- fprintf(stderr, _("The -p option only supported "
- "in raw mode\n"));
+ fprintf(stderr, "%s",
+ _("The -p option only supported in raw mode\n"));
exit(1);
}
if (img_type)
ext2fs_close (fs);
if (check)
- printf(_("%d blocks already contained the data to be copied.\n"),
+ printf(_("%d blocks already contained the data to be copied\n"),
skipped_blocks);
out: