From bb12ff83564d43566089dd979639c6993ba76665 Mon Sep 17 00:00:00 2001 From: Maarten Bosmans Date: Thu, 6 Jan 2011 00:51:33 +0100 Subject: Apply #ifdefs around functionality not available on win32 And also the reverse: around some win32 specific functionality --- src/pulsecore/memtrap.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/pulsecore/memtrap.c') diff --git a/src/pulsecore/memtrap.c b/src/pulsecore/memtrap.c index 4fc18210..b56d806a 100644 --- a/src/pulsecore/memtrap.c +++ b/src/pulsecore/memtrap.c @@ -24,7 +24,10 @@ #endif #include + +#ifdef HAVE_SYS_MMAN_H #include +#endif /* This is deprecated on glibc but is still used by FreeBSD */ #if !defined(MAP_ANONYMOUS) && defined(MAP_ANON) @@ -68,6 +71,7 @@ static void sigsafe_error(const char *s) { (void) write(STDERR_FILENO, s, strlen(s)); } +#ifdef HAVE_SIGACTION static void signal_handler(int sig, siginfo_t* si, void *data) { unsigned j; pa_memtrap *m; @@ -102,6 +106,7 @@ fail: sigsafe_error("Failed to handle SIGBUS.\n"); abort(); } +#endif static void memtrap_link(pa_memtrap *m, unsigned j) { pa_assert(m); @@ -221,6 +226,7 @@ unlock: } void pa_memtrap_install(void) { +#ifdef HAVE_SIGACTION struct sigaction sa; allocate_aupdate(); @@ -230,4 +236,5 @@ void pa_memtrap_install(void) { sa.sa_flags = SA_RESTART|SA_SIGINFO; pa_assert_se(sigaction(SIGBUS, &sa, NULL) == 0); +#endif } -- cgit