mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-03 09:01:50 -05:00
core-util: move personality resetting into core-util
This commit is contained in:
parent
9f53aa5546
commit
ef176ecb62
3 changed files with 16 additions and 9 deletions
|
|
@ -65,10 +65,6 @@
|
||||||
#include <dbus/dbus.h>
|
#include <dbus/dbus.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
#include <sys/personality.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <pulse/mainloop.h>
|
#include <pulse/mainloop.h>
|
||||||
#include <pulse/mainloop-signal.h>
|
#include <pulse/mainloop-signal.h>
|
||||||
#include <pulse/timeval.h>
|
#include <pulse/timeval.h>
|
||||||
|
|
@ -446,11 +442,7 @@ int main(int argc, char *argv[]) {
|
||||||
* context we have been started. Let's cleanup our execution
|
* context we have been started. Let's cleanup our execution
|
||||||
* context as good as possible */
|
* context as good as possible */
|
||||||
|
|
||||||
#ifdef __linux__
|
pa_reset_personality();
|
||||||
if (personality(PER_LINUX) < 0)
|
|
||||||
pa_log_warn("Uh, personality() failed: %s", pa_cstrerror(errno));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pa_drop_root();
|
pa_drop_root();
|
||||||
pa_close_all(passed_fd, -1);
|
pa_close_all(passed_fd, -1);
|
||||||
pa_reset_sigs(-1);
|
pa_reset_sigs(-1);
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,10 @@
|
||||||
#include "rtkit.h"
|
#include "rtkit.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
#include <sys/personality.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <pulse/xmalloc.h>
|
#include <pulse/xmalloc.h>
|
||||||
#include <pulse/util.h>
|
#include <pulse/util.h>
|
||||||
#include <pulse/utf8.h>
|
#include <pulse/utf8.h>
|
||||||
|
|
@ -2855,3 +2859,12 @@ size_t pa_pipe_buf(int fd) {
|
||||||
return 4096;
|
return 4096;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void pa_reset_personality(void) {
|
||||||
|
|
||||||
|
#ifdef __linux__
|
||||||
|
if (personality(PER_LINUX) < 0)
|
||||||
|
pa_log_warn("Uh, personality() failed: %s", pa_cstrerror(errno));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 */
|
/* Returns size of the specified pipe or 4096 on failure */
|
||||||
size_t pa_pipe_buf(int fd);
|
size_t pa_pipe_buf(int fd);
|
||||||
|
|
||||||
|
void pa_reset_personality(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue