From: <ro...@us...> - 2003-01-08 21:43:35
|
Update of /cvsroot/ltp/ltp/testcases/kernel/mem/shmt In directory sc8-pr-cvs1:/tmp/cvs-serv29701 Modified Files: shmt04.c shmt06.c Log Message: Applied patch created by Sundar and Dan Kegel. Index: shmt04.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/mem/shmt/shmt04.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- shmt04.c 23 Dec 2002 17:01:50 -0000 1.1 +++ shmt04.c 8 Jan 2003 21:43:27 -0000 1.2 @@ -53,21 +53,17 @@ extern int errno; -char *TCID="shmt03"; /* Test program identifier. */ +char *TCID="shmt04"; /* Test program identifier. */ int TST_TOTAL=2; /* Total number of test cases. */ extern int Tst_count; /* Test Case counter for tst_* routines */ /**************/ key_t key; +sigset_t sigset; #define ADDR (void *)0x80000 #define SIZE 16*1024 -/* ARGSUSED */ -void -sigusr1(int sig) -{ -} int child(); int rm_shm(int); @@ -79,8 +75,11 @@ int status; key = (key_t) getpid() ; - signal(SIGUSR1, sigusr1); + sigemptyset(&sigset); + sigaddset(&sigset,SIGUSR1); + sigprocmask(SIG_BLOCK,&sigset,NULL); + pid = fork(); switch (pid) { case -1: @@ -159,8 +158,9 @@ int shmid, chld_pid ; char *cp; + int sig; - pause(); + sigwait(&sigset, &sig); chld_pid = getpid() ; /*--------------------------------------------------------*/ Index: shmt06.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/mem/shmt/shmt06.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- shmt06.c 23 Dec 2002 17:01:51 -0000 1.1 +++ shmt06.c 8 Jan 2003 21:43:28 -0000 1.2 @@ -62,12 +62,7 @@ /**************/ key_t key; - -/* ARGSUSED */ -void -sigusr1(int sig) -{ -} +sigset_t sigset; int child(); int rm_shm(int); @@ -80,7 +75,9 @@ key = (key_t)getpid() ; - signal(SIGUSR1, sigusr1); + sigemptyset(&sigset); + sigaddset(&sigset,SIGUSR1); + sigprocmask(SIG_BLOCK,&sigset,NULL); pid = fork(); switch (pid) { @@ -160,8 +157,9 @@ int shmid , chld_pid ; char *cp; + int sig; - pause(); + sigwait(&sigset, &sig); chld_pid = getpid() ; if ((shmid = shmget(key, SIZE, 0)) < 0) { |