From c369d42df84f5bdabcac9041e6c5680a0cbfeaf9 Mon Sep 17 00:00:00 2001 From: bluhm <> Date: Mon, 9 Nov 2020 23:18:51 +0000 Subject: Sync libc syscall tests with changes in upstream NetBSD. Use #ifdef to document differences to NetBSD behaviour, this helps to track upstream. Mark currently failing test as expected failures. So test programs get compiled and executed, but it shows that further investigation is necceassry. --- src/regress/lib/libc/sys/t_pipe2.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src/regress/lib/libc/sys/t_pipe2.c') diff --git a/src/regress/lib/libc/sys/t_pipe2.c b/src/regress/lib/libc/sys/t_pipe2.c index 4964be14ce..07991de455 100644 --- a/src/regress/lib/libc/sys/t_pipe2.c +++ b/src/regress/lib/libc/sys/t_pipe2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: t_pipe2.c,v 1.1.1.1 2019/11/19 19:57:04 bluhm Exp $ */ +/* $OpenBSD: t_pipe2.c,v 1.2 2020/11/09 23:18:51 bluhm Exp $ */ /* $NetBSD: t_pipe2.c,v 1.9 2017/01/13 21:19:45 christos Exp $ */ /*- @@ -81,16 +81,16 @@ run(int flags) ATF_REQUIRE((fcntl(fd[1], F_GETFL) & O_NONBLOCK) == 0); } - /* - * Adjusted for OpenBSD, not available - * if (flags & O_NOSIGPIPE) { - * ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) != 0); - * ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) != 0); - *} else { - * ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) == 0); - * ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) == 0); - *} - */ +#ifndef __OpenBSD__ + /* F_GETNOSIGPIPE not available */ + if (flags & O_NOSIGPIPE) { + ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) != 0); + ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) != 0); + } else { + ATF_REQUIRE(fcntl(fd[0], F_GETNOSIGPIPE) == 0); + ATF_REQUIRE(fcntl(fd[1], F_GETNOSIGPIPE) == 0); + } +#endif ATF_REQUIRE(close(fd[0]) != -1); ATF_REQUIRE(close(fd[1]) != -1); @@ -193,10 +193,10 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, pipe2_consume); ATF_TP_ADD_TC(tp, pipe2_nonblock); ATF_TP_ADD_TC(tp, pipe2_cloexec); - /* - * Adjusted for OpenBSD, not available - * ATF_TP_ADD_TC(tp, pipe2_nosigpipe); - */ +#ifndef __OpenBSD__ + /* O_NOSIGPIPE not available */ + ATF_TP_ADD_TC(tp, pipe2_nosigpipe); +#endif ATF_TP_ADD_TC(tp, pipe2_einval); return atf_no_error(); -- cgit v1.2.3-55-g6feb