Fix MacOS passsigalrm.c compilation error due to SIGRTMIN not existing on MacOS

The test will very probably fail on MacOS (as gdb output will contain SIGUSR1
rather than signal SIGRTMIN, but at least it should compile).
(not tested on MacOS; just tested that it still works on linux)



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12594
This commit is contained in:
Philippe Waroquiers 2012-05-29 17:04:13 +00:00
parent abadfaacdc
commit 95a346248f
3 changed files with 13 additions and 8 deletions

View File

@ -3,9 +3,9 @@ target remote | ./vgdb --wait=60 --vgdb-prefix=./vgdb-prefix-nlpasssigalrm
echo vgdb launched process attached\n
monitor v.set vgdb-error 999999
# break on breakme++:
break passsigalrm.c:48
break passsigalrm.c:53
# break on the next line:
break passsigalrm.c:50
break passsigalrm.c:55
#
#
# ensure SIGALRM can be passed directly to the process, without

View File

@ -1,5 +1,5 @@
Breakpoint 1 at 0x........: file passsigalrm.c, line 48.
Breakpoint 2 at 0x........: file passsigalrm.c, line 50.
Breakpoint 1 at 0x........: file passsigalrm.c, line 53.
Breakpoint 2 at 0x........: file passsigalrm.c, line 55.
Signal Stop Print Pass to program Description
SIGALRM Yes Yes Yes Alarm clock
Continuing.
@ -8,12 +8,12 @@ Program received signal SIGALRM, Alarm clock.
Signal Stop Print Pass to program Description
SIGALRM No No Yes Alarm clock
Continuing.
Breakpoint 1, main (argc=1, argv=0x........) at passsigalrm.c:48
48 breakme++;
Breakpoint 1, main (argc=1, argv=0x........) at passsigalrm.c:53
53 breakme++;
$1 = 0
Continuing.
Breakpoint 2, main (argc=1, argv=0x........) at passsigalrm.c:50
50 sa.sa_handler = sigrtmin_handler;
Breakpoint 2, main (argc=1, argv=0x........) at passsigalrm.c:55
55 sa.sa_handler = sigrtmin_handler;
$2 = 1
Continuing.
Program received signal SIG34, Real-time event 34.

View File

@ -15,6 +15,11 @@ static void sigrtmin_handler(int signr)
}
static int breakme = 0;
#ifndef SIGRTMIN
// at least on MacOS, there is no SIGRTMIN.
// So, use any other signal instead.
#define SIGRTMIN SIGUSR1
#endif
int main (int argc, char *argv[])
{