*: remove some uses of argc
[oweals/busybox.git] / e2fsprogs / old_e2fsprogs / e2fsck.c
index 741536c1c58a702d8535f7e98c6c73c1f0b4aee7..c715d3e9ae226d9cbc454575118496ec7e28b02d 100644 (file)
@@ -1886,7 +1886,7 @@ static void e2fsck_journal_reset_super(e2fsck_t ctx, journal_superblock_t *jsb,
        int i;
 
        /* Leave a valid existing V1 superblock signature alone.
-        * Anything unrecognisable we overwrite with a new V2
+        * Anything unrecognizable we overwrite with a new V2
         * signature. */
 
        if (jsb->s_header.h_magic != htonl(JFS_MAGIC_NUMBER) ||
@@ -2270,7 +2270,7 @@ static void e2fsck_move_ext3_journal(e2fsck_t ctx)
        ext2fs_mark_super_dirty(fs);
        fs->flags &= ~EXT2_FLAG_MASTER_SB_ONLY;
        inode.i_links_count = 0;
-       inode.i_dtime = time(0);
+       inode.i_dtime = time(NULL);
        if ((retval = ext2fs_write_inode(fs, ino, &inode)) != 0)
                goto err_out;
 
@@ -3381,7 +3381,7 @@ static void e2fsck_pass1(e2fsck_t ctx)
                         */
                        if (!LINUX_S_ISDIR(inode->i_mode)) {
                                if (fix_problem(ctx, PR_1_ROOT_NO_DIR, &pctx)) {
-                                       inode->i_dtime = time(0);
+                                       inode->i_dtime = time(NULL);
                                        inode->i_links_count = 0;
                                        ext2fs_icount_store(ctx->inode_link_info,
                                                            ino, 0);
@@ -3475,7 +3475,7 @@ static void e2fsck_pass1(e2fsck_t ctx)
                    inode->i_dtime < ctx->fs->super->s_inodes_count) {
                        if (fix_problem(ctx, PR_1_LOW_DTIME, &pctx)) {
                                inode->i_dtime = inode->i_links_count ?
-                                       0 : time(0);
+                                       0 : time(NULL);
                                e2fsck_write_inode(ctx, ino, inode,
                                                   "pass1");
                        }
@@ -3489,7 +3489,7 @@ static void e2fsck_pass1(e2fsck_t ctx)
                        if (!inode->i_dtime && inode->i_mode) {
                                if (fix_problem(ctx,
                                            PR_1_ZERO_DTIME, &pctx)) {
-                                       inode->i_dtime = time(0);
+                                       inode->i_dtime = time(NULL);
                                        e2fsck_write_inode(ctx, ino, inode,
                                                           "pass1");
                                }
@@ -3659,7 +3659,7 @@ static void e2fsck_pass1(e2fsck_t ctx)
                }
                e2fsck_read_inode(ctx, EXT2_RESIZE_INO, inode,
                                  "recreate inode");
-               inode->i_mtime = time(0);
+               inode->i_mtime = time(NULL);
                e2fsck_write_inode(ctx, EXT2_RESIZE_INO, inode,
                                  "recreate inode");
                fs->block_map = save_bmap;
@@ -4169,7 +4169,7 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
        if (pb.clear) {
                inode->i_links_count = 0;
                ext2fs_icount_store(ctx->inode_link_info, ino, 0);
-               inode->i_dtime = time(0);
+               inode->i_dtime = time(NULL);
                dirty_inode++;
                ext2fs_unmark_inode_bitmap(ctx->inode_dir_map, ino);
                ext2fs_unmark_inode_bitmap(ctx->inode_reg_map, ino);
@@ -4202,7 +4202,7 @@ static void check_blocks(e2fsck_t ctx, struct problem_context *pctx,
                if (fix_problem(ctx, PR_1_ZERO_LENGTH_DIR, pctx)) {
                        inode->i_links_count = 0;
                        ext2fs_icount_store(ctx->inode_link_info, ino, 0);
-                       inode->i_dtime = time(0);
+                       inode->i_dtime = time(NULL);
                        dirty_inode++;
                        ext2fs_unmark_inode_bitmap(ctx->inode_dir_map, ino);
                        ext2fs_unmark_inode_bitmap(ctx->inode_reg_map, ino);
@@ -5147,7 +5147,7 @@ static void delete_file(e2fsck_t ctx, ext2_ino_t ino,
        /* Inode may have changed by block_iterate, so reread it */
        e2fsck_read_inode(ctx, ino, &inode, "delete_file");
        inode.i_links_count = 0;
-       inode.i_dtime = time(0);
+       inode.i_dtime = time(NULL);
        if (inode.i_file_acl &&
            (fs->super->s_feature_compat & EXT2_FEATURE_COMPAT_EXT_ATTR)) {
                count = 1;
@@ -6393,7 +6393,7 @@ static void deallocate_inode(e2fsck_t ctx, ext2_ino_t ino, char* block_buf)
        ext2fs_icount_store(ctx->inode_link_info, ino, 0);
        e2fsck_read_inode(ctx, ino, &inode, "deallocate_inode");
        inode.i_links_count = 0;
-       inode.i_dtime = time(0);
+       inode.i_dtime = time(NULL);
        e2fsck_write_inode(ctx, ino, &inode, "deallocate_inode");
        clear_problem_context(&pctx);
        pctx.ino = ino;
@@ -6890,7 +6890,7 @@ static void check_root(e2fsck_t ctx)
        memset(&inode, 0, sizeof(inode));
        inode.i_mode = 040755;
        inode.i_size = fs->blocksize;
-       inode.i_atime = inode.i_ctime = inode.i_mtime = time(0);
+       inode.i_atime = inode.i_ctime = inode.i_mtime = time(NULL);
        inode.i_links_count = 2;
        inode.i_blocks = fs->blocksize / 512;
        inode.i_block[0] = blk;
@@ -7138,7 +7138,7 @@ ext2_ino_t e2fsck_get_lost_and_found(e2fsck_t ctx, int fix)
        memset(&inode, 0, sizeof(inode));
        inode.i_mode = 040700;
        inode.i_size = fs->blocksize;
-       inode.i_atime = inode.i_ctime = inode.i_mtime = time(0);
+       inode.i_atime = inode.i_ctime = inode.i_mtime = time(NULL);
        inode.i_links_count = 2;
        inode.i_blocks = fs->blocksize / 512;
        inode.i_block[0] = blk;
@@ -7492,7 +7492,7 @@ static int disconnect_inode(e2fsck_t ctx, ext2_ino_t i)
                if (fix_problem(ctx, PR_4_ZERO_LEN_INODE, &pctx)) {
                        ext2fs_icount_store(ctx->inode_link_info, i, 0);
                        inode.i_links_count = 0;
-                       inode.i_dtime = time(0);
+                       inode.i_dtime = time(NULL);
                        e2fsck_write_inode(ctx, i, &inode,
                                           "disconnect_inode");
                        /*
@@ -9400,7 +9400,7 @@ static const struct e2fsck_problem problem_table[] = {
 
        /* Cannot proceed without a root inode. */
        { PR_3_NO_ROOT_INODE_ABORT,
-         N_("Cannot proceed without a @r.\n"),
+         N_("can't proceed without a @r.\n"),
          PROMPT_NONE, PR_FATAL },
 
        /* Internal error: couldn't find dir_info */
@@ -11558,7 +11558,7 @@ static int release_orphan_inodes(e2fsck_t ctx)
                if (!inode.i_links_count) {
                        ext2fs_inode_alloc_stats2(fs, ino, -1,
                                                  LINUX_S_ISDIR(inode.i_mode));
-                       inode.i_dtime = time(0);
+                       inode.i_dtime = time(NULL);
                } else {
                        inode.i_dtime = 0;
                }
@@ -12632,7 +12632,7 @@ static void check_mount(e2fsck_t ctx)
        retval = ext2fs_check_if_mounted(ctx->filesystem_name,
                                         &ctx->mount_flags);
        if (retval) {
-               bb_error_msg(_("while determining whether %s is mounted."),
+               bb_error_msg(_("while determining whether %s is mounted"),
                        ctx->filesystem_name);
                return;
        }
@@ -12653,7 +12653,7 @@ static void check_mount(e2fsck_t ctx)
 
        printf(_("%s is mounted.  "), ctx->filesystem_name);
        if (!ctx->interactive)
-               bb_error_msg_and_die(_("Cannot continue, aborting."));
+               bb_error_msg_and_die(_("can't continue, aborting"));
        printf(_("\n\n\007\007\007\007WARNING!!!  "
               "Running e2fsck on a mounted filesystem may cause\n"
               "SEVERE filesystem damage.\007\007\007\n\n"));
@@ -12714,7 +12714,7 @@ static void check_if_skip(e2fsck_t ctx)
        unsigned int reason_arg = 0;
        long next_check;
        int batt = is_on_batt();
-       time_t now = time(0);
+       time_t now = time(NULL);
 
        if ((ctx->options & E2F_OPT_FORCE) || cflag || swapfs)
                return;
@@ -12892,7 +12892,7 @@ static int e2fsck_update_progress(e2fsck_t ctx, int pass,
 
        if (ctx->progress_fd) {
                sprintf(buf, "%d %lu %lu\n", pass, cur, max);
-               write(ctx->progress_fd, buf, strlen(buf));
+               xwrite_str(ctx->progress_fd, buf);
        } else {
                percent = calc_percent(&e2fsck_tbl, pass, cur, max);
                e2fsck_simple_progress(ctx, ctx->device_name,
@@ -13060,7 +13060,7 @@ static errcode_t PRS(int argc, char **argv, e2fsck_t *ret_ctx)
                case 'a':
                        if (ctx->options & (E2F_OPT_YES|E2F_OPT_NO)) {
                        conflict_opt:
-                               bb_error_msg_and_die(_("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;
@@ -13373,7 +13373,7 @@ restart:
                                 * happen, unless the hardware or
                                 * device driver is being bogus.
                                 */
-                               bb_error_msg(_("cannot set superblock flags on %s"), ctx->device_name);
+                               bb_error_msg(_("can't set superblock flags on %s"), ctx->device_name);
                                bb_error_msg_and_die(0);
                        }
                        retval = e2fsck_run_ext3_journal(ctx);
@@ -13405,7 +13405,7 @@ restart:
 #ifdef ENABLE_COMPRESSION
        /* FIXME - do we support this at all? */
        if (sb->s_feature_incompat & EXT2_FEATURE_INCOMPAT_COMPRESSION)
-               bb_error_msg(_("Warning: compression support is experimental."));
+               bb_error_msg(_("warning: compression support is experimental"));
 #endif
 #ifndef ENABLE_HTREE
        if (sb->s_feature_compat & EXT2_FEATURE_COMPAT_DIR_INDEX) {