[LTP] [PATCH 5/5] syscalls/flock06: Rewrite to new library
Jan Stancek
jstancek@redhat.com
Thu Aug 2 14:29:24 CEST 2018
----- Original Message -----
> Signed-off-by: Jinhui huang <huangjh.jy@cn.fujitsu.com>
> ---
> testcases/kernel/syscalls/flock/flock06.c | 213
> ++++++++----------------------
> 1 file changed, 52 insertions(+), 161 deletions(-)
Hi,
> + int fd1, fd2;
> +
> + fd1 = SAFE_OPEN("testfile", O_RDWR);
> + TEST(flock(fd1, LOCK_EX | LOCK_NB));
> + if (TST_RET != 0)
> + tst_res(TFAIL | TTERRNO, "First attempt to flock() failed");
> + else
> + tst_res(TPASS, "First attempt to flock() passed");
> +
> + fd2 = SAFE_OPEN("testfile", O_RDWR);
> + TEST(flock(fd2, LOCK_EX | LOCK_NB));
> + if (TST_RET != 1)
This should be == -1
The rest looks good to me.
Regards,
Jan
More information about the ltp
mailing list