static volatile void usage (char *prog)
{
- fprintf (stderr, "usage: %s [-d debug_flags] [-f] [-F] [-p] device [new-size]\n\n", prog);
+ fprintf (stderr, _("usage: %s [-d debug_flags] [-f] [-F] [-p] device [new-size]\n\n"), prog);
exit (1);
}
progress = 0;
switch (pass) {
case E2_RSZ_EXTEND_ITABLE_PASS:
- label = "Extending the inode table";
+ label = _("Extending the inode table");
break;
case E2_RSZ_BLOCK_RELOC_PASS:
- label = "Relocating blocks";
+ label = _("Relocating blocks");
break;
case E2_RSZ_INODE_SCAN_PASS:
- label = "Scanning inode table";
+ label = _("Scanning inode table");
break;
case E2_RSZ_INODE_REF_UPD_PASS:
- label = "Updating inode references";
+ label = _("Updating inode references");
break;
case E2_RSZ_MOVE_ITABLE_PASS:
- label = "Moving inode table";
+ label = _("Moving inode table");
break;
default:
- label = "Unknown pass?!?";
+ label = _("Unknown pass?!?");
break;
}
- printf("Begin pass %d (max = %lu)\n", pass, max);
+ printf(_("Begin pass %d (max = %lu)\n"), pass, max);
retval = ext2fs_progress_init(&progress, label, 30,
40, max, 0);
if (retval)
retval = ext2fs_check_if_mounted(device, &mount_flags);
if (retval) {
- com_err("ext2fs_check_if_mount", retval,
- "while determining whether %s is mounted.",
+ com_err(_("ext2fs_check_if_mount"), retval,
+ _("while determining whether %s is mounted."),
device);
return;
}
if (!(mount_flags & EXT2_MF_MOUNTED))
return;
- fprintf(stderr, "%s is mounted; can't resize a "
- "mounted filesystem!\n\n", device);
+ fprintf(stderr, _("%s is mounted; can't resize a "
+ "mounted filesystem!\n\n"), device);
exit(1);
}
initialize_ext2_error_table();
- fprintf (stderr, "resize2fs %s (%s)\n",
+ fprintf (stderr, _("resize2fs %s (%s)\n"),
E2FSPROGS_VERSION, E2FSPROGS_DATE);
if (argc && *argv)
program_name = *argv;
if (optind < argc) {
new_size = strtoul(argv[optind++], &tmp, 0);
if (*tmp) {
- com_err(program_name, 0, "bad filesystem size - %s",
+ com_err(program_name, 0, _("bad filesystem size - %s"),
argv[optind - 1]);
exit(1);
}
fd = open(device_name, O_RDONLY, 0);
if (fd < 0) {
- com_err("open", errno, "while opening %s for flushing",
+ com_err("open", errno,
+ _("while opening %s for flushing"),
device_name);
exit(1);
}
if (ioctl(fd, BLKFLSBUF, 0) < 0) {
- com_err("BLKFLSBUF", errno, "while trying to flush %s",
+ com_err("BLKFLSBUF", errno,
+ _("while trying to flush %s"),
device_name);
exit(1);
}
close(fd);
#else
- fprintf(stderr, "BLKFLSBUF not supported");
+ fprintf(stderr, _("BLKFLSBUF not supported"));
exit(1);
#endif /* BLKFLSBUF */
}
retval = ext2fs_open (device_name, EXT2_FLAG_RW, 0, 0,
io_ptr, &fs);
if (retval) {
- com_err (program_name, retval, "while trying to open %s",
+ com_err (program_name, retval, _("while trying to open %s"),
device_name);
- printf ("Couldn't find valid filesystem superblock.\n");
+ printf (_("Couldn't find valid filesystem superblock.\n"));
exit (1);
}
/*
&max_size);
if (retval) {
com_err(program_name, retval,
- "while trying to determine filesystem size");
+ _("while trying to determine filesystem size"));
exit(1);
}
if (!new_size)
new_size = max_size;
if (!force && (new_size > max_size)) {
- fprintf(stderr, "The containing partition (or device)"
+ fprintf(stderr, _("The containing partition (or device)"
" is only %d blocks.\nYou requested a new size"
- " of %d blocks.\n\n", max_size,
+ " of %d blocks.\n\n"), max_size,
new_size);
exit(1);
}
if (new_size == fs->super->s_blocks_count) {
- fprintf(stderr, "The filesystem is already %d blocks "
- "long. Nothing to do!\n\n", new_size);
+ fprintf(stderr, _("The filesystem is already %d blocks "
+ "long. Nothing to do!\n\n"), new_size);
exit(0);
}
if (!force && (fs->super->s_lastcheck < fs->super->s_mtime)) {
- fprintf(stderr, "Please run 'e2fsck -f %s' first.\n\n",
+ fprintf(stderr, _("Please run 'e2fsck -f %s' first.\n\n"),
device_name);
exit(1);
}
((flags & RESIZE_PERCENT_COMPLETE) ?
resize_progress_func : 0));
if (retval) {
- com_err(program_name, retval, "while trying to resize %s",
+ com_err(program_name, retval, _("while trying to resize %s"),
device_name);
ext2fs_close (fs);
}
- printf("The filesystem on %s is now %d blocks long.\n\n",
+ printf(_("The filesystem on %s is now %d blocks long.\n\n"),
device_name, new_size);
return (0);
}
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & RESIZE_DEBUG_BMOVE)
- printf("Number of free blocks: %d/%d, Needed: %d\n",
+ printf(_("Number of free blocks: %d/%d, Needed: %d\n"),
rfs->old_fs->super->s_free_blocks_count,
rfs->new_fs->super->s_free_blocks_count,
rfs->needed_blocks);
ext2fs_block_bitmap bmap;
errcode_t retval;
- retval = ext2fs_allocate_block_bitmap(fs, "meta-data blocks", &bmap);
+ retval = ext2fs_allocate_block_bitmap(fs, _("meta-data blocks"),
+ &bmap);
if (retval)
return retval;
if (old_fs->super->s_blocks_count > fs->super->s_blocks_count)
fs = rfs->old_fs;
- retval = ext2fs_allocate_block_bitmap(fs, "reserved blocks",
+ retval = ext2fs_allocate_block_bitmap(fs, _("reserved blocks"),
&rfs->reserve_blocks);
if (retval)
return retval;
- retval = ext2fs_allocate_block_bitmap(fs, "blocks to be moved",
+ retval = ext2fs_allocate_block_bitmap(fs, _("blocks to be moved"),
&rfs->move_blocks);
if (retval)
return retval;
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & RESIZE_DEBUG_BMOVE)
- printf("Going into desperation "
- "mode for block allocations\n");
+ printf(_("Going into desperation "
+ "mode for block allocations\n"));
#endif
rfs->alloc_state = DESPERATION;
rfs->new_blk = fs->super->s_first_data_block;
break;
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & RESIZE_DEBUG_BMOVE)
- printf("Moving %d blocks %u->%u\n", size,
+ printf(_("Moving %d blocks %u->%u\n"), size,
old_blk, new_blk);
#endif
do {
pb->changed = 1;
#ifdef RESIZE2FS_DEBUG
if (pb->rfs->flags & RESIZE_DEBUG_BMOVE)
- printf("ino=%ld, blockcnt=%ld, %u->%u\n",
+ printf(_("ino=%ld, blockcnt=%ld, %u->%u\n"),
pb->ino, blockcnt, block, new_block);
#endif
block = new_block;
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & RESIZE_DEBUG_INODEMAP)
- printf("Inode moved %ld->%ld\n", ino, new_inode);
+ printf(_("Inode moved %ld->%ld\n"), ino, new_inode);
#endif
if (!rfs->imap) {
retval = ext2fs_create_extent_table(&rfs->imap, 0);
return 0;
#ifdef RESIZE2FS_DEBUG
if (is->rfs->flags & RESIZE_DEBUG_INODEMAP)
- printf("Inode translate (dir=%ld, name=%.*s, %u->%ld)\n",
+ printf(_("Inode translate (dir=%ld, name=%.*s, %u->%ld)\n"),
dir, dirent->name_len, dirent->name,
dirent->inode, new_inode);
#endif
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & RESIZE_DEBUG_ITABLEMOVE)
- printf("Itable move group %d block "
- "%u->%u (diff %d)\n",
+ printf(_("Itable move group %d block "
+ "%u->%u (diff %d)\n"),
i, old_blk, new_blk, diff);
#endif
n = n >> EXT2_BLOCK_SIZE_BITS(fs->super);
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & RESIZE_DEBUG_ITABLEMOVE)
- printf("%d blocks of zeros...\n", n);
+ printf(_("%d blocks of zeros...\n"), n);
#endif
num = fs->inode_blocks_per_group;
if (n > diff)
ext2fs_flush(fs);
#ifdef RESIZE2FS_DEBUG
if (rfs->flags & RESIZE_DEBUG_ITABLEMOVE)
- printf("Inode table move finished.\n");
+ printf(_("Inode table move finished.\n"));
#endif
return 0;