[LTP] [PATCH v2] syscalls/access04: Convert to new API && Rename

Cyril Hrubis chrubis@suse.cz
Wed Nov 2 14:39:46 CET 2016


Hi!
> +static void cleanup(void)
> +{
> +	if (mount_flag && tst_umount(MNT_POINT) < 0) {
> +		tst_brk(TBROK | TERRNO, "umount device:%s failed",
> +			tst_device->dev);
> +	}
> +}

You must not call tst_brk() from the test cleanup, that would cause
infinite loop and segfault. You should call tst_res(TWARN, "...");
instead.

And the tst_umount() calls tst_res(TWARN, "..."); already so we can just
do:

...
	if (mount_flag)
		tst_umount(MNT_POINT);
...

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list