From 9c87a65ce91c38b60c19ae108a51a2e8ce46a85c Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 19 Jul 2006 17:44:19 +0000 Subject: * 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 --- src/pulsecore/pid.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'src/pulsecore/pid.c') 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: -- cgit