]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: fix context test logic
authorKarel Zak <kzak@redhat.com>
Thu, 26 Jan 2012 14:01:01 +0000 (15:01 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 26 Jan 2012 14:01:01 +0000 (15:01 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context.c

index ac48fce3683f2fb6cf36a6dafa3ce9addf69872e..4494ac6c1ecbae8d3106cbd7ed9a0184e7a126c5 100644 (file)
@@ -1997,7 +1997,7 @@ int test_mount(struct libmnt_test *ts, int argc, char *argv[])
                mnt_context_set_target(cxt, argv[idx++]);
        }
 
-       /* this is unnecessary -- libmount is able to internaly
+       /* this is unnecessary! -- libmount is able to internaly
         * create and manage the lock
         */
        lock = mnt_context_get_lock(cxt);
@@ -2010,6 +2010,7 @@ int test_mount(struct libmnt_test *ts, int argc, char *argv[])
        else
                printf("successfully mounted\n");
 
+       lock = NULL;    /* because we use atexit lock_fallback */
        mnt_free_context(cxt);
        return rc;
 }
@@ -2064,6 +2065,7 @@ int test_umount(struct libmnt_test *ts, int argc, char *argv[])
        else
                printf("successfully umounted\n");
 err:
+       lock = NULL;    /* because we use atexit lock_fallback */
        mnt_free_context(cxt);
        return rc;
 }