From ef176ecb62a8f04bd14ca37e7c2a40469f0bb8ba Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 12 Aug 2009 21:36:52 +0200 Subject: core-util: move personality resetting into core-util --- src/pulsecore/core-util.c | 13 +++++++++++++ src/pulsecore/core-util.h | 2 ++ 2 files changed, 15 insertions(+) (limited to 'src/pulsecore') diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index d4baf697..6494244e 100644 --- a/src/pulsecore/core-util.c +++ b/src/pulsecore/core-util.c @@ -101,6 +101,10 @@ #include "rtkit.h" #endif +#ifdef __linux__ +#include +#endif + #include #include #include @@ -2855,3 +2859,12 @@ size_t pa_pipe_buf(int fd) { return 4096; #endif } + +void pa_reset_personality(void) { + +#ifdef __linux__ + if (personality(PER_LINUX) < 0) + pa_log_warn("Uh, personality() failed: %s", pa_cstrerror(errno)); +#endif + +} diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h index 6de4b771..3d3aec71 100644 --- a/src/pulsecore/core-util.h +++ b/src/pulsecore/core-util.h @@ -241,4 +241,6 @@ char* pa_maybe_prefix_path(const char *path, const char *prefix); /* Returns size of the specified pipe or 4096 on failure */ size_t pa_pipe_buf(int fd); +void pa_reset_personality(void); + #endif -- cgit