mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
* add new --system command line parameter to the daemon for running PulseAudio as system-wide instance
* add PA_ prefixes to all global #defines * modify auth-by-creds: define a new group "pulse-access" which is used for authentication * add proper privilige dropping when running in --system mode * create runtime directory once on startup and not by each module seperately git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@1105 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
9db70682d6
commit
9c87a65ce9
28 changed files with 403 additions and 135 deletions
|
|
@ -79,13 +79,10 @@ static pid_t read_pid(const char *fn, int fd) {
|
|||
|
||||
static int open_pid_file(const char *fn, int mode) {
|
||||
int fd = -1;
|
||||
int lock = -1;
|
||||
|
||||
for (;;) {
|
||||
struct stat st;
|
||||
|
||||
pa_make_secure_parent_dir(fn);
|
||||
|
||||
if ((fd = open(fn, mode, S_IRUSR|S_IWUSR)) < 0) {
|
||||
if (mode != O_RDONLY || errno != ENOENT)
|
||||
pa_log_warn(__FILE__": WARNING: failed to open PID file '%s': %s",
|
||||
|
|
@ -123,10 +120,8 @@ static int open_pid_file(const char *fn, int mode) {
|
|||
|
||||
fail:
|
||||
|
||||
if (fd < 0) {
|
||||
if (lock >= 0)
|
||||
pa_lock_fd(fd, 0);
|
||||
|
||||
if (fd >= 0) {
|
||||
pa_lock_fd(fd, 0);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
|
|
@ -199,7 +194,6 @@ int pa_pid_file_remove(void) {
|
|||
char fn[PATH_MAX];
|
||||
int ret = -1;
|
||||
pid_t pid;
|
||||
char *p;
|
||||
|
||||
pa_runtime_path("pid", fn, sizeof(fn));
|
||||
|
||||
|
|
@ -235,11 +229,6 @@ int pa_pid_file_remove(void) {
|
|||
goto fail;
|
||||
}
|
||||
|
||||
if ((p = pa_parent_dir(fn))) {
|
||||
rmdir(p);
|
||||
pa_xfree(p);
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
||||
fail:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue