[LTP] [PATCH v4 2/2] lib/tst_test.c: Add .needs_devfs flag

Cyril Hrubis chrubis@suse.cz
Fri Aug 31 14:31:02 CEST 2018


Hi!
> +static void prepare_and_mount_dev_fs(const char *mntpoint)
> +{
> +	const char *flags[] = {"nodev", NULL};
> +	int mounted_nodev;
> +
> +	mounted_nodev = tst_path_has_mnt_flags(NULL, NULL, flags);
> +	if (mounted_nodev) {
> +		tst_res(TINFO, "tmpdir isn't suitable for creating devices, "
> +			"so mount tmpfs without nodev on %s", mntpoint);
> +		SAFE_MOUNT(NULL, mntpoint, "tmpfs", 0, NULL);
> +		mntpoint_mounted = 1;
> +	}
> +}

That is even better than my version, nice :-).

There is a last nit to solve, the problem is that
tst_path_has_mnt_flags() is defined in old/test.h, we have to move the
definition to a separate header file (in a separate patch) so that it
could be included in test.h, tst_path_has_mnt_flags.c, and tst_test.c.

I can do that or you can sent v5, your choice.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list