summaryrefslogtreecommitdiffstats
path: root/src/pulsecore/pid.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pulsecore/pid.c')
-rw-r--r--src/pulsecore/pid.c15
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: