mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-03-31 11:32:17 +02:00
Include <unistd.h>.
(sighandler): Correct return type to "void". Delete unused variables buffer[] and n. (main): Cast sighandler to (sighandler_t). (Logical change 1.19)
This commit is contained in:
parent
21647f4830
commit
7e8c5066e8
1 changed files with 3 additions and 5 deletions
|
@ -18,6 +18,7 @@ GNU General Public License for more details. */
|
|||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <libunwind.h>
|
||||
|
||||
#define panic(args...) \
|
||||
|
@ -67,12 +68,9 @@ foo (void)
|
|||
printf ("[%d] ip=%p\n", i, buffer[i]);
|
||||
}
|
||||
|
||||
int
|
||||
void
|
||||
sighandler (int signal, void *siginfo, struct sigcontext *sc)
|
||||
{
|
||||
void *buffer[20];
|
||||
int n;
|
||||
|
||||
printf ("sighandler: got signal %d @ %lx\n", signal, sc->sc_ip);
|
||||
|
||||
do_backtrace();
|
||||
|
@ -83,7 +81,7 @@ main (int argc, char **argv)
|
|||
{
|
||||
foo ();
|
||||
|
||||
signal (SIGTERM, sighandler);
|
||||
signal (SIGTERM, (sighandler_t) sighandler);
|
||||
kill (getpid (), SIGTERM);
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue