File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1
- /* $OpenBSD: t_kill.c,v 1.1.1.1 2019/11/19 19:57:03 bluhm Exp $ */
1
+ /* $OpenBSD: t_kill.c,v 1.2 2021/07/29 15:33:17 anton Exp $ */
2
2
/* $NetBSD: t_kill.c,v 1.1 2011/07/07 06:57:53 jruoho Exp $ */
3
3
4
4
/*-
@@ -60,6 +60,17 @@ ATF_TC_BODY(kill_basic, tc)
60
60
int sta ;
61
61
62
62
for (i = 0 ; i < __arraycount (sig ); i ++ ) {
63
+ struct sigaction act , oact ;
64
+
65
+ /* Ensure the signal is not ignored. */
66
+ if (sig [i ] != SIGKILL ) {
67
+ memset (& act , 0 , sizeof (act ));
68
+ act .sa_handler = SIG_DFL ;
69
+ ATF_REQUIRE (sigaction (sig [i ], & act , & oact ) == 0 );
70
+ } else {
71
+ ATF_REQUIRE (sigaction (sig [i ], & act , & oact ) != 0 );
72
+ ATF_REQUIRE (errno == EINVAL );
73
+ }
63
74
64
75
pid = fork ();
65
76
ATF_REQUIRE (pid >= 0 );
@@ -78,6 +89,9 @@ ATF_TC_BODY(kill_basic, tc)
78
89
79
90
if (WIFSIGNALED (sta ) == 0 || WTERMSIG (sta ) != sig [i ])
80
91
atf_tc_fail ("kill(2) failed to kill child" );
92
+
93
+ if (sig [i ] != SIGKILL )
94
+ ATF_REQUIRE (sigaction (sig [i ], & oact , NULL ) == 0 );
81
95
}
82
96
}
83
97
You can’t perform that action at this time.
0 commit comments