[LTP] [PATCH v5 3/5] llistxattr: improved code readability and stability

Cyril Hrubis chrubis@suse.cz
Mon Dec 5 17:02:02 CET 2016


Hi!
> -	TEST(llistxattr(t->path, buf, t->size));
> -	if (TEST_RETURN != -1) {
> +	TEST(llistxattr(t->path, buf, sizeof(buf)));
> +	if (TEST_RETURN == 0) {
>  		tst_res(TFAIL, "llistxattr() succeeded unexpectedly");
> +		return;
> +	}

I've changed this check back to TEST_RETURN != -1 since the call must
return -1 on failure. The manual page says that it either returns -1 or
size of the copied data. Hence even if it returns -2 it's a bug in
libc/kernel.

And I've did the same change for the newly introduced listxattr() and
flistxattr() tests and pushed the rest of the patchset, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list