diff options
author | Lennart Poettering <lennart@poettering.net> | 2006-07-19 17:44:19 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2006-07-19 17:44:19 +0000 |
commit | 9c87a65ce91c38b60c19ae108a51a2e8ce46a85c (patch) | |
tree | 36cca05b57ef1148ea16889ccdfef4536b300cb9 /src/pulsecore/pid.c | |
parent | 9db70682d68cc4fef9314677b6427582e5d5c8f2 (diff) |
* 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
Diffstat (limited to 'src/pulsecore/pid.c')
-rw-r--r-- | src/pulsecore/pid.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/pulsecore/pid.c b/src/pulsecore/pid.c index 0ad76a6e..044d223d 100644 --- a/src/pulsecore/pid.c +++ b/src/pulsecore/pid.c @@ -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: |