mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
signal: Avoid system signal disposition to interfere with tests
Both tst-sigset2 and tst-signal1 expectes that SIGINT disposition is set to SIG_DFL.
This commit is contained in:
parent
96d1b9ac23
commit
2e53eb9234
@ -11,6 +11,8 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <libc-diag.h>
|
#include <libc-diag.h>
|
||||||
|
|
||||||
|
#include <support/xsignal.h>
|
||||||
|
|
||||||
/* The sigset function is deprecated. */
|
/* The sigset function is deprecated. */
|
||||||
DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations");
|
DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations");
|
||||||
|
|
||||||
@ -148,6 +150,8 @@ returnTest3 (void)
|
|||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
xsignal (TEST_SIG, SIG_DFL);
|
||||||
|
|
||||||
pid_t childPid;
|
pid_t childPid;
|
||||||
|
|
||||||
childPid = fork();
|
childPid = fork();
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
||||||
#include <support/xunistd.h>
|
#include <support/xunistd.h>
|
||||||
|
#include <support/xsignal.h>
|
||||||
|
|
||||||
static sigset_t ss;
|
static sigset_t ss;
|
||||||
static pthread_barrier_t *b;
|
static pthread_barrier_t *b;
|
||||||
@ -93,6 +94,8 @@ receiver (void)
|
|||||||
static int
|
static int
|
||||||
do_test (void)
|
do_test (void)
|
||||||
{
|
{
|
||||||
|
xsignal (SIGINT, SIG_DFL);
|
||||||
|
|
||||||
char tmp[] = "/tmp/tst-signal1-XXXXXX";
|
char tmp[] = "/tmp/tst-signal1-XXXXXX";
|
||||||
|
|
||||||
int fd = mkstemp (tmp);
|
int fd = mkstemp (tmp);
|
||||||
|
Loading…
Reference in New Issue
Block a user