diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-11-04 10:28:20 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-11-04 10:28:20 +0200 |
commit | 73f61ecf05ff1679219e49bfd029a69da66bf35e (patch) | |
tree | c1a384c16f3531549b0f2ac36abf9a5946374ed2 | |
parent | dc06dca3b99f809f826f25565ace384b54f3b488 (diff) | |
download | librpm-tizen-73f61ecf05ff1679219e49bfd029a69da66bf35e.tar.gz librpm-tizen-73f61ecf05ff1679219e49bfd029a69da66bf35e.tar.bz2 librpm-tizen-73f61ecf05ff1679219e49bfd029a69da66bf35e.zip |
Fix building on systems where SA_SIGINFO isn't available (ticket #4)
- patch from Adam Tkac
-rw-r--r-- | rpmio/rpmsq.c | 6 | ||||
-rw-r--r-- | rpmio/rpmsq.h | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/rpmio/rpmsq.c b/rpmio/rpmsq.c index 45c9a60b2..d6d77f1de 100644 --- a/rpmio/rpmsq.c +++ b/rpmio/rpmsq.c @@ -152,7 +152,7 @@ static sigset_t rpmsqCaught; static struct rpmsig_s { int signum; - void (*handler) (int signum, void * info, void * context); + rpmsqAction_t handler; int active; struct sigaction oact; } rpmsigTbl[] = { @@ -254,7 +254,11 @@ int rpmsqEnable(int signum, rpmsqAction_t handler) continue; (void) sigemptyset (&sa.sa_mask); +#ifdef SA_SIGINFO sa.sa_flags = SA_SIGINFO; +#else + sa.sa_flags = 0; +#endif sa.sa_sigaction = (void*)(handler != NULL ? handler : tbl->handler); if (sigaction(tbl->signum, &sa, &tbl->oact) < 0) { SUB_REF(tbl); diff --git a/rpmio/rpmsq.h b/rpmio/rpmsq.h index a78403bae..0b34e037e 100644 --- a/rpmio/rpmsq.h +++ b/rpmio/rpmsq.h @@ -7,6 +7,7 @@ */ #include <rpm/rpmsw.h> +#include <signal.h> #ifdef __cplusplus extern "C" { @@ -26,7 +27,11 @@ typedef struct rpmsqElem * rpmsq; * @param info (siginfo_t) signal info * @param context signal context */ +#ifdef SA_SIGINFO typedef void (*rpmsqAction_t) (int signum, void * info, void * context); +#else +typedef void (*rpmsqAction_t) (int signum); +#endif extern int _rpmsq_debug; |