Whamcloud - gitweb
Make the e2fsck man page clear that the -c, -l, and -L options are
[tools/e2fsprogs.git] / e2fsck / e2fsck.c
index 4c593f3..7d2ccf6 100644 (file)
@@ -21,6 +21,7 @@ errcode_t e2fsck_allocate_context(e2fsck_t *ret)
 {
        e2fsck_t        context;
        errcode_t       retval;
+       char            *time_env;
 
        retval = ext2fs_get_mem(sizeof(struct e2fsck_struct), &context);
        if (retval)
@@ -30,6 +31,12 @@ errcode_t e2fsck_allocate_context(e2fsck_t *ret)
 
        context->process_inode_size = 256;
        context->ext_attr_ver = 2;
+       
+       time_env = getenv("E2FSCK_TIME");
+       if (time_env)
+               context->now = strtoul(time_env, NULL, 0);
+       else
+               context->now = time(0);
 
        *ret = context;
        return 0;
@@ -180,8 +187,10 @@ int e2fsck_run(e2fsck_t ctx)
        pass_t  e2fsck_pass;
 
 #ifdef HAVE_SETJMP_H
-       if (setjmp(ctx->abort_loc))
+       if (setjmp(ctx->abort_loc)) {
+               ctx->flags &= ~E2F_FLAG_SETJMP_OK;
                return (ctx->flags & E2F_FLAG_RUN_RETURN);
+       }
        ctx->flags |= E2F_FLAG_SETJMP_OK;
 #endif