From: Lennart Poettering Date: Wed, 12 Aug 2009 19:36:52 +0000 (+0200) Subject: core-util: move personality resetting into core-util X-Git-Tag: 1.0_branch~1489 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ef176ecb62a8f04bd14ca37e7c2a40469f0bb8ba;p=profile%2Fivi%2Fpulseaudio.git core-util: move personality resetting into core-util --- diff --git a/src/daemon/main.c b/src/daemon/main.c index 7a95195..355b0d5 100644 --- a/src/daemon/main.c +++ b/src/daemon/main.c @@ -65,10 +65,6 @@ #include #endif -#ifdef __linux__ -#include -#endif - #include #include #include @@ -446,11 +442,7 @@ int main(int argc, char *argv[]) { * context we have been started. Let's cleanup our execution * context as good as possible */ -#ifdef __linux__ - if (personality(PER_LINUX) < 0) - pa_log_warn("Uh, personality() failed: %s", pa_cstrerror(errno)); -#endif - + pa_reset_personality(); pa_drop_root(); pa_close_all(passed_fd, -1); pa_reset_sigs(-1); diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c index d4baf69..6494244 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 6de4b77..3d3aec7 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