* e2fsck
*
* Copyright (C) 1993, 1994, 1995, 1996, 1997 Theodore Ts'o.
+ * Copyright (C) 2006 Garrett Kajmowicz
* This file may be
* redistributed under the terms of the GNU Public License.
*
#include "e2fsck.h" /*Put all of our defines here to clean things up*/
-#ifdef __GNUC__
-#define _INLINE_ __inline__
-#define EXT2FS_ATTR(x) __attribute__(x)
-#else
-#define _INLINE_
-#define EXT2FS_ATTR(x)
-#endif
-
/*
* Procedure declarations
*/
* functions.
*/
-static _INLINE_ kmem_cache_t * do_cache_create(int len)
+static kmem_cache_t * do_cache_create(int len)
{
kmem_cache_t *new_cache;
return new_cache;
}
-static _INLINE_ void do_cache_destroy(kmem_cache_t *cache)
+static void do_cache_destroy(kmem_cache_t *cache)
{
free(cache);
}
retval = ext2fs_block_iterate(fs, EXT2_BAD_INO, 0, 0,
check_bb_inode_blocks, 0);
if (retval) {
- com_err("ext2fs_block_iterate", retval,
- _("while sanity checking the bad blocks inode"));
+ bb_error_msg(_("while sanity checking the bad blocks inode"));
goto fatal;
}
if (!replace_bad_blocks) {
retval = ext2fs_read_bb_inode(fs, &bb_list);
if (retval) {
- com_err("ext2fs_read_bb_inode", retval,
- _("while reading the bad blocks inode"));
+ bb_error_msg(_("while reading the bad blocks inode"));
goto fatal;
}
}
if (bad_blocks_file) {
f = fopen(bad_blocks_file, "r");
if (!f) {
- com_err("read_bad_blocks_file", errno,
- _("while trying to open %s"), bad_blocks_file);
+ bb_error_msg(_("while trying to open %s"), bad_blocks_file);
goto fatal;
}
} else {
fs->device_name, fs->super->s_blocks_count);
f = popen(buf, "r");
if (!f) {
- com_err("read_bad_blocks_file", errno,
- _("while trying popen '%s'"), buf);
+ bb_error_msg(_("while trying popen '%s'"), buf);
goto fatal;
}
}
else
pclose(f);
if (retval) {
- com_err("ext2fs_read_bb_FILE", retval,
- _("while reading in list of bad blocks from file"));
+ bb_error_msg(_("while reading in list of bad blocks from file"));
goto fatal;
}
*/
retval = ext2fs_update_bb_inode(fs, bb_list);
if (retval) {
- com_err("ext2fs_update_bb_inode", retval,
- _("while updating bad block inode"));
+ bb_error_msg(_("while updating bad block inode"));
goto fatal;
}
#define dict_root(D) ((D)->nilnode.left)
#define dict_nil(D) (&(D)->nilnode)
-#define DICT_DEPTH_MAX 64
static void dnode_free(dnode_t *node);
* any later version.
*/
-#define MNT_FL (MS_MGC_VAL | MS_RDONLY)
-
/*
* Define USE_INODE_IO to use the inode_io.c / fileio.c codepaths.
* This creates a larger static binary, and a smaller binary using
bh->b_blocknr,
1, bh->b_data);
if (retval) {
- com_err(bh->b_ctx->device_name, retval,
- "while reading block %lu\n",
+ bb_error_msg("while reading block %lu\n",
(unsigned long) bh->b_blocknr);
bh->b_err = retval;
continue;
bh->b_blocknr,
1, bh->b_data);
if (retval) {
- com_err(bh->b_ctx->device_name, retval,
- "while writing block %lu\n",
+ bb_error_msg("while writing block %lu\n",
(unsigned long) bh->b_blocknr);
bh->b_err = retval;
continue;
memcpy(&jsuper, start ? bh->b_data : bh->b_data + 1024,
sizeof(jsuper));
brelse(bh);
-#ifdef EXT2FS_ENABLE_SWAPFS
+#if BB_BIG_ENDIAN
if (jsuper.s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC))
ext2fs_swap_super(&jsuper);
#endif
ll_rw_block(READ, 1, &jbh);
if (jbh->b_err) {
- com_err(ctx->device_name, jbh->b_err,
- _("reading journal superblock\n"));
+ bb_error_msg(_("reading journal superblock\n"));
return jbh->b_err;
}
* format to be able to proceed safely, so any other checks that
* fail we should attempt to recover from. */
if (jsb->s_blocksize != htonl(journal->j_blocksize)) {
- com_err(ctx->program_name, EXT2_ET_CORRUPT_SUPERBLOCK,
- _("%s: no valid journal superblock found\n"),
+ bb_error_msg(_("%s: no valid journal superblock found\n"),
ctx->device_name);
return EXT2_ET_CORRUPT_SUPERBLOCK;
}
if (ntohl(jsb->s_maxlen) < journal->j_maxlen)
journal->j_maxlen = ntohl(jsb->s_maxlen);
else if (ntohl(jsb->s_maxlen) > journal->j_maxlen) {
- com_err(ctx->program_name, EXT2_ET_CORRUPT_SUPERBLOCK,
- _("%s: journal too short\n"),
+ bb_error_msg(_("%s: journal too short\n"),
ctx->device_name);
return EXT2_ET_CORRUPT_SUPERBLOCK;
}
&ctx->fs);
if (retval) {
- com_err(ctx->program_name, retval,
- _("while trying to re-open %s"),
+ bb_error_msg(_("while trying to re-open %s"),
ctx->device_name);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
ctx->fs->priv_data = ctx;
/*
* This function expands '%dX' expressions
*/
-static _INLINE_ void expand_dirent_expression(char ch,
+static void expand_dirent_expression(char ch,
struct problem_context *ctx)
{
struct ext2_dir_entry *dirent;
}
}
-static _INLINE_ void expand_percent_expression(ext2_filsys fs, char ch,
+static void expand_percent_expression(ext2_filsys fs, char ch,
struct problem_context *ctx)
{
if (!ctx)
static void mark_inode_bad(e2fsck_t ctx, ino_t ino);
static void handle_fs_bad_blocks(e2fsck_t ctx);
static void process_inodes(e2fsck_t ctx, char *block_buf);
-static EXT2_QSORT_TYPE process_inode_cmp(const void *a, const void *b);
+static int process_inode_cmp(const void *a, const void *b);
static errcode_t scan_callback(ext2_filsys fs, ext2_inode_scan scan,
dgrp_t group, void * priv_data);
static void adjust_extattr_refcount(e2fsck_t ctx, ext2_refcount_t refcount,
ehandler_operation(old_operation);
}
-static EXT2_QSORT_TYPE process_inode_cmp(const void *a, const void *b)
+static int process_inode_cmp(const void *a, const void *b)
{
const struct process_inode_block *ib_a =
(const struct process_inode_block *) a;
* WARNING: Assumes checks have already been done to make sure block
* is valid. This is true in both process_block and process_bad_block.
*/
-static _INLINE_ void mark_block_used(e2fsck_t ctx, blk_t block)
+static void mark_block_used(e2fsck_t ctx, blk_t block)
{
struct problem_context pctx;
p = (struct dup_block *) dnode_get(n);
decrement_badcount(ctx, *block_nr, p);
} else
- com_err("delete_file_block", 0,
- _("internal error; can't find dup_blk for %d\n"),
+ bb_error_msg(_("internal error; can't find dup_blk for %d\n"),
*block_nr);
} else {
ext2fs_unmark_block_bitmap(ctx->block_found_map, *block_nr);
ext2fs_mark_block_bitmap(fs->block_map, new_block);
return BLOCK_CHANGED;
} else
- com_err("clone_file_block", 0,
- _("internal error; can't find dup_blk for %d\n"),
+ bb_error_msg(_("internal error; can't find dup_blk for %d\n"),
*block_nr);
}
return 0;
goto errout;
}
if (cs.errcode) {
- com_err("clone_file", cs.errcode,
- _("returned from clone_file_block"));
+ bb_error_msg(_("returned from clone_file_block"));
retval = cs.errcode;
goto errout;
}
static void clear_htree(e2fsck_t ctx, ext2_ino_t ino);
static int htree_depth(struct dx_dir_info *dx_dir,
struct dx_dirblock_info *dx_db);
-static EXT2_QSORT_TYPE special_dir_block_cmp(const void *a, const void *b);
+static int special_dir_block_cmp(const void *a, const void *b);
struct check_dir_struct {
char *buf;
* This guarantees that the root node of the htree directories are
* processed first, so we know what hash version to use.
*/
-static EXT2_QSORT_TYPE special_dir_block_cmp(const void *a, const void *b)
+static int special_dir_block_cmp(const void *a, const void *b)
{
const struct ext2_db_entry *db_a =
(const struct ext2_db_entry *) a;
return 0;
}
-static _INLINE_ int check_filetype(e2fsck_t ctx,
+static int check_filetype(e2fsck_t ctx,
struct ext2_dir_entry *dirent,
struct problem_context *pctx)
{
!(fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_EXT_ATTR) &&
fix_problem(ctx, PR_2_FILE_ACL_ZERO, &pctx)) {
inode.i_file_acl = 0;
-#ifdef EXT2FS_ENABLE_SWAPFS
+#if BB_BIG_ENDIAN
/*
* This is a special kludge to deal with long symlinks
* on big endian systems. i_blocks had already been
preenhalt(ctx);
if (ptr->flags & PR_FATAL)
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
if (ptr->prompt == PROMPT_NONE) {
if (ptr->flags & PR_NOCOLLATE)
}
if ((ptr->prompt == PROMPT_ABORT) && answer)
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
if (ptr->flags & PR_AFTER_CODE)
answer = fix_problem(ctx, ptr->second_code, pctx);
}
/* Used for sorting the hash entry */
-static EXT2_QSORT_TYPE name_cmp(const void *a, const void *b)
+static int name_cmp(const void *a, const void *b)
{
const struct hash_entry *he_a = (const struct hash_entry *) a;
const struct hash_entry *he_b = (const struct hash_entry *) b;
}
/* Used for sorting the hash entry */
-static EXT2_QSORT_TYPE hash_cmp(const void *a, const void *b)
+static int hash_cmp(const void *a, const void *b)
{
const struct hash_entry *he_a = (const struct hash_entry *) a;
const struct hash_entry *he_b = (const struct hash_entry *) b;
retval = ext2fs_block_iterate2(fs, ino, BLOCK_FLAG_DEPTH_TRAVERSE,
block_buf, release_inode_block, &pb);
if (retval) {
- com_err("release_inode_blocks", retval,
- _("while calling ext2fs_block_iterate for inode %d"),
+ bb_error_msg(_("while calling ext2fs_block_iterate for inode %d"),
ino);
return 1;
}
count = 1;
}
if (retval) {
- com_err("release_inode_blocks", retval,
- _("while calling ext2fs_adjust_ea_refocunt for inode %d"),
+ bb_error_msg(_("while calling ext2fs_adjust_ea_refocunt for inode %d"),
ino);
return 1;
}
retval = ext2fs_block_iterate(ctx->fs, ino, 0, block_buf,
swap_block, &sb);
if (retval) {
- com_err("swap_inode_blocks", retval,
- _("while calling ext2fs_block_iterate"));
+ bb_error_msg(_("while calling ext2fs_block_iterate"));
ctx->flags |= E2F_FLAG_ABORT;
return;
}
if (sb.errcode) {
- com_err("swap_inode_blocks", sb.errcode,
- _("while calling iterator function"));
+ bb_error_msg(_("while calling iterator function"));
ctx->flags |= E2F_FLAG_ABORT;
return;
}
retval = ext2fs_get_mem(fs->blocksize * fs->inode_blocks_per_group,
&buf);
if (retval) {
- com_err("swap_inodes", retval,
- _("while allocating inode buffer"));
+ bb_error_msg(_("while allocating inode buffer"));
ctx->flags |= E2F_FLAG_ABORT;
return;
}
fs->group_desc[group].bg_inode_table,
fs->inode_blocks_per_group, buf);
if (retval) {
- com_err("swap_inodes", retval,
- _("while reading inode table (group %d)"),
+ bb_error_msg(_("while reading inode table (group %d)"),
group);
ctx->flags |= E2F_FLAG_ABORT;
return;
fs->group_desc[group].bg_inode_table,
fs->inode_blocks_per_group, buf);
if (retval) {
- com_err("swap_inodes", retval,
- _("while writing inode table (group %d)"),
+ bb_error_msg(_("while writing inode table (group %d)"),
group);
ctx->flags |= E2F_FLAG_ABORT;
return;
ext2fs_flush_icache(fs);
}
-#if defined(__powerpc__) && defined(EXT2FS_ENABLE_SWAPFS)
+#if defined(__powerpc__) && BB_BIG_ENDIAN
/*
* On the PowerPC, the big-endian variant of the ext2 filesystem
* has its bitmaps stored as 32-bit words with bit 0 as the LSB
ret = malloc(size);
if (!ret) {
sprintf(buf, "Can't allocate %s\n", description);
- fatal_error(ctx, buf);
+ bb_error_msg_and_die(buf);
}
memset(ret, 0, size);
return ret;
errcode_t retval;
if (ctx->invalid_bitmaps) {
- com_err(ctx->program_name, 0,
- _("e2fsck_read_bitmaps: illegal bitmap block(s) for %s"),
+ bb_error_msg(_("e2fsck_read_bitmaps: illegal bitmap block(s) for %s"),
ctx->device_name);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
ehandler_operation(_("reading inode and block bitmaps"));
retval = ext2fs_read_bitmaps(fs);
ehandler_operation(0);
if (retval) {
- com_err(ctx->program_name, retval,
- _("while retrying to read bitmaps for %s"),
+ bb_error_msg(_("while retrying to read bitmaps for %s"),
ctx->device_name);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
}
retval = ext2fs_write_block_bitmap(fs);
ehandler_operation(0);
if (retval) {
- com_err(ctx->program_name, retval,
- _("while retrying to write block bitmaps for %s"),
+ bb_error_msg(_("while retrying to write block bitmaps for %s"),
ctx->device_name);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
}
retval = ext2fs_write_inode_bitmap(fs);
ehandler_operation(0);
if (retval) {
- com_err(ctx->program_name, retval,
- _("while retrying to write inode bitmaps for %s"),
+ bb_error_msg(_("while retrying to write inode bitmaps for %s"),
ctx->device_name);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
}
}
retval = ext2fs_read_inode(ctx->fs, ino, inode);
if (retval) {
- com_err("ext2fs_read_inode", retval,
- _("while reading inode %ld in %s"), ino, proc);
- fatal_error(ctx, 0);
+ bb_error_msg(_("while reading inode %ld in %s"), ino, proc);
+ bb_error_msg_and_die(0);
}
}
retval = ext2fs_write_inode_full(ctx->fs, ino, inode, bufsize);
if (retval) {
- com_err("ext2fs_write_inode", retval,
- _("while writing inode %ld in %s"), ino, proc);
- fatal_error(ctx, 0);
+ bb_error_msg(_("while writing inode %ld in %s"), ino, proc);
+ bb_error_msg_and_die(0);
}
}
retval = ext2fs_write_inode(ctx->fs, ino, inode);
if (retval) {
- com_err("ext2fs_write_inode", retval,
- _("while writing inode %ld in %s"), ino, proc);
- fatal_error(ctx, 0);
+ bb_error_msg(_("while writing inode %ld in %s"), ino, proc);
+ bb_error_msg_and_die(0);
}
}
if (io_channel_read_blk(io, superblock,
-SUPERBLOCK_SIZE, buf))
continue;
-#ifdef EXT2FS_ENABLE_SWAPFS
+#if BB_BIG_ENDIAN
if (sb->s_magic == ext2fs_swab16(EXT2_SUPER_MAGIC))
ext2fs_swap_super(sb);
#endif
retval = ext2fs_check_if_mounted(ctx->filesystem_name,
&ctx->mount_flags);
if (retval) {
- com_err("ext2fs_check_if_mount", retval,
- _("while determining whether %s is mounted."),
+ bb_error_msg(_("while determining whether %s is mounted."),
ctx->filesystem_name);
return;
}
printf(_("%s is mounted. "), ctx->filesystem_name);
if (!ctx->interactive)
- fatal_error(ctx, _("Cannot continue, aborting.\n\n"));
+ bb_error_msg_and_die(_("Cannot continue, aborting.\n\n"));
printf(_("\n\n\007\007\007\007WARNING!!! "
"Running e2fsck on a mounted filesystem may cause\n"
"SEVERE filesystem damage.\007\007\007\n\n"));
_("Error validating file descriptor %d: %s\n"),
ctx->progress_fd,
error_message(errno));
- fatal_error(ctx,
- _("Invalid completion information file descriptor"));
+ bb_error_msg_and_die(_("Invalid completion information file descriptor"));
} else
close(fd);
break;
case 'a':
if (ctx->options & (E2F_OPT_YES|E2F_OPT_NO)) {
conflict_opt:
- fatal_error(ctx,
- _("Only one the options -p/-a, -n or -y may be specified."));
+ bb_error_msg_and_die(_("Only one the options -p/-a, -n or -y may be specified."));
}
ctx->options |= E2F_OPT_PREEN;
break;
keep_bad_blocks++;
break;
default:
- usage();
+ bb_show_usage();
}
if (show_version_only)
return 0;
if (optind != argc - 1)
- usage();
+ bb_show_usage();
if ((ctx->options & E2F_OPT_NO) && !bad_blocks_file &&
!cflag && !swapfs && !(ctx->options & E2F_OPT_COMPRESS_DIRS))
ctx->options |= E2F_OPT_READONLY;
*ctx->io_options++ = 0;
ctx->filesystem_name = blkid_get_devname(ctx->blkid, argv[optind], 0);
if (!ctx->filesystem_name) {
- com_err(ctx->program_name, 0, _("Unable to resolve '%s'"),
- argv[optind]);
- fatal_error(ctx, 0);
+ bb_error_msg(_("Unable to resolve '%s'"), argv[optind]);
+ bb_error_msg_and_die(0);
}
if (extended_opts)
parse_extended_opts(ctx, extended_opts);
if (flush) {
fd = open(ctx->filesystem_name, O_RDONLY, 0);
if (fd < 0) {
- com_err("open", errno,
- _("while opening %s for flushing"),
+ bb_error_msg(_("while opening %s for flushing"),
ctx->filesystem_name);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
if ((retval = ext2fs_sync_device(fd, 1))) {
- com_err("ext2fs_sync_device", retval,
- _("while trying to flush %s"),
+ bb_error_msg(_("while trying to flush %s"),
ctx->filesystem_name);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
close(fd);
}
retval = PRS(argc, argv, &ctx);
if (retval) {
- com_err("e2fsck", retval,
- _("while trying to initialize program"));
+ bb_error_msg(_("while trying to initialize program"));
exit(EXIT_ERROR);
}
reserve_stdio_fds();
!(ctx->options & E2F_OPT_NO) &&
!(ctx->options & E2F_OPT_YES)) {
if (!ctx->interactive)
- fatal_error(ctx,
- _("need terminal for interactive repairs"));
+ bb_error_msg_and_die(_("need terminal for interactive repairs"));
}
ctx->superblock = ctx->use_superblock;
restart:
}
}
if (retval) {
- com_err(ctx->program_name, retval, _("while trying to open %s"),
+ bb_error_msg(_("while trying to open %s"),
ctx->filesystem_name);
if (retval == EXT2_ET_REV_TOO_HIGH) {
printf(_("The filesystem revision is apparently "
#endif
else
fix_problem(ctx, PR_0_SB_CORRUPT, &pctx);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
ctx->fs = fs;
fs->priv_data = ctx;
sb = fs->super;
if (sb->s_rev_level > E2FSCK_CURRENT_REV) {
- com_err(ctx->program_name, EXT2_ET_REV_TOO_HIGH,
- _("while trying to open %s"),
+ bb_error_msg(_("while trying to open %s"),
ctx->filesystem_name);
get_newer:
- fatal_error(ctx, _("Get a newer version of e2fsck!"));
+ bb_error_msg_and_die(_("Get a newer version of e2fsck!"));
}
/*
*/
retval = e2fsck_check_ext3_journal(ctx);
if (retval) {
- com_err(ctx->program_name, retval,
- _("while checking ext3 journal for %s"),
+ bb_error_msg(_("while checking ext3 journal for %s"),
ctx->device_name);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
/*
* happen, unless the hardware or
* device driver is being bogus.
*/
- com_err(ctx->program_name, 0,
- _("unable to set superblock flags on %s\n"), ctx->device_name);
- fatal_error(ctx, 0);
+ bb_error_msg(_("unable to set superblock flags on %s\n"), ctx->device_name);
+ bb_error_msg_and_die(0);
}
retval = e2fsck_run_ext3_journal(ctx);
if (retval) {
- com_err(ctx->program_name, retval,
- _("while recovering ext3 journal of %s"),
+ bb_error_msg(_("while recovering ext3 journal of %s"),
ctx->device_name);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
ext2fs_close(ctx->fs);
ctx->fs = 0;
*/
if ((sb->s_feature_compat & ~EXT2_LIB_FEATURE_COMPAT_SUPP) ||
(sb->s_feature_incompat & ~EXT2_LIB_FEATURE_INCOMPAT_SUPP)) {
- com_err(ctx->program_name, EXT2_ET_UNSUPP_FEATURE,
- "(%s)", ctx->device_name);
+ bb_error_msg("(%s)", ctx->device_name);
goto get_newer;
}
if (sb->s_feature_ro_compat & ~EXT2_LIB_FEATURE_RO_COMPAT_SUPP) {
- com_err(ctx->program_name, EXT2_ET_RO_UNSUPP_FEATURE,
- "(%s)", ctx->device_name);
+ bb_error_msg("(%s)", ctx->device_name);
goto get_newer;
}
#ifdef ENABLE_COMPRESSION
/* FIXME - do we support this at all? */
if (sb->s_feature_incompat & EXT2_FEATURE_INCOMPAT_COMPRESSION)
- com_err(ctx->program_name, 0,
- _("Warning: compression support is experimental.\n"));
+ bb_error_msg(_("Warning: compression support is experimental.\n"));
#endif
#ifndef ENABLE_HTREE
if (sb->s_feature_compat & EXT2_FEATURE_COMPAT_DIR_INDEX) {
- com_err(ctx->program_name, 0,
- _("E2fsck not compiled with HTREE support,\n\t"
+ bb_error_msg(_("E2fsck not compiled with HTREE support,\n\t"
"but filesystem %s has HTREE directories.\n"),
ctx->device_name);
goto get_newer;
ext2fs_mark_valid(fs);
check_super_block(ctx);
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
check_if_skip(ctx);
if (bad_blocks_file)
read_bad_blocks_file(ctx, bad_blocks_file, replace_bad_blocks);
else if (cflag)
read_bad_blocks_file(ctx, 0, !keep_bad_blocks); /* Test disk */
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
#ifdef ENABLE_SWAPFS
#ifdef WORDS_BIGENDIAN
if ((fs->flags & EXT2_FLAG_SWAP_BYTES) == NATIVE_FLAG) {
fprintf(stderr, _("%s: Filesystem byte order "
"already normalized.\n"), ctx->device_name);
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
}
if (swapfs) {
swap_filesys(ctx);
if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
- fatal_error(ctx, 0);
+ bb_error_msg_and_die(0);
}
#endif
retval = ext2fs_read_bb_inode(fs, &fs->badblocks);
if (retval) {
- com_err(ctx->program_name, retval,
- _("while reading bad blocks inode"));
+ bb_error_msg(_("while reading bad blocks inode"));
preenhalt(ctx);
printf(_("This doesn't bode well,"
" but we'll try to go on...\n"));
printf(_("Restarting e2fsck from the beginning...\n"));
retval = e2fsck_reset_context(ctx);
if (retval) {
- com_err(ctx->program_name, retval,
- _("while resetting context"));
- fatal_error(ctx, 0);
+ bb_error_msg(_("while resetting context"));
+ bb_error_msg_and_die(0);
}
ext2fs_close(fs);
goto restart;
exit_value |= FSCK_CANCELED;
}
if (run_result & E2F_FLAG_ABORT)
- fatal_error(ctx, _("aborted"));
+ bb_error_msg_and_die(_("aborted"));
/* Cleanup */
if (ext2fs_test_changed(fs)) {