Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/sys Den't set SA_RESTART in the signal handle...



details:   https://anonhg.NetBSD.org/src/rev/c77164e65bdb
branches:  trunk
changeset: 365571:c77164e65bdb
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Aug 22 06:31:37 2018 +0000

description:
Den't set SA_RESTART in the signal handler allowing the process to get
interrupted durning recv and exit (pointed out by kre@)

diffstat:

 tests/lib/libc/sys/t_sendrecv.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 4767d0c0ef01 -r c77164e65bdb tests/lib/libc/sys/t_sendrecv.c
--- a/tests/lib/libc/sys/t_sendrecv.c   Wed Aug 22 03:12:31 2018 +0000
+++ b/tests/lib/libc/sys/t_sendrecv.c   Wed Aug 22 06:31:37 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_sendrecv.c,v 1.3 2018/08/21 11:04:49 christos Exp $  */
+/*     $NetBSD: t_sendrecv.c,v 1.4 2018/08/22 06:31:37 christos Exp $  */
 
 /*-
  * Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_sendrecv.c,v 1.3 2018/08/21 11:04:49 christos Exp $");
+__RCSID("$NetBSD: t_sendrecv.c,v 1.4 2018/08/22 06:31:37 christos Exp $");
 
 #include <atf-c.h>
 #include <sys/types.h>
@@ -115,14 +115,14 @@
        int fd[2], error;
        struct sigaction sa;
 
-       atf_tc_fail("does not terminate");
+//     atf_tc_fail("does not terminate");
 
        error = socketpair(AF_UNIX, SOCK_DGRAM, 0, fd);
 //     error = pipe(fd);
        ATF_REQUIRE_MSG(error != -1, "socketpair failed (%s)", strerror(errno));
 
        memset(&sa, 0, sizeof(sa));
-       sa.sa_flags = SA_RESTART;
+       sa.sa_flags = 0;
        sa.sa_handler = &handle_sigchld;
        sigemptyset(&sa.sa_mask);
        error = sigaction(SIGCHLD, &sa, 0);



Home | Main Index | Thread Index | Old Index