Lines Matching refs:fn
51 static pid_t read_pid(const char *fn, int fd) { in read_pid() argument
56 pa_assert(fn); in read_pid()
60 pa_log_warn("Failed to read PID file '%s': %s", fn, pa_cstrerror(errno)); in read_pid()
72 pa_log_warn("Failed to parse PID file '%s'", fn); in read_pid()
80 static int open_pid_file(const char *fn, int mode) { in open_pid_file() argument
83 pa_assert(fn); in open_pid_file()
88 if ((fd = pa_open_cloexec(fn, mode in open_pid_file()
95 pa_log_warn("Failed to open PID file '%s': %s", fn, pa_cstrerror(errno)); in open_pid_file()
104 pa_log_warn("Failed to fstat() PID file '%s': %s", fn, pa_cstrerror(errno)); in open_pid_file()
116 pa_log_warn("Failed to close file '%s': %s", fn, pa_cstrerror(errno)); in open_pid_file()
191 char *fn; local
197 if (!(fn = pa_runtime_path("pid")))
200 if ((fd = open_pid_file(fn, O_CREAT|O_RDWR)) < 0)
203 if ((pid = read_pid(fn, fd)) == (pid_t) -1)
234 pa_log("Failed to truncate PID file '%s': %s", fn, pa_cstrerror(errno));
253 pa_log("Failed to close PID file '%s': %s", fn, pa_cstrerror(errno));
258 pa_xfree(fn);
266 char *fn; local
270 if (!(fn = pa_runtime_path("pid")))
273 if ((fd = open_pid_file(fn, O_RDWR)) < 0) {
274 pa_log_warn("Failed to open PID file '%s': %s", fn, pa_cstrerror(errno));
278 if ((pid = read_pid(fn, fd)) == (pid_t) -1)
282 pa_log("PID file '%s' not mine!", fn);
287 pa_log_warn("Failed to truncate PID file '%s': %s", fn, pa_cstrerror(errno));
297 if (unlink(fn) < 0) {
298 pa_log_warn("Failed to remove PID file '%s': %s", fn, pa_cstrerror(errno));
310 pa_log_warn("Failed to close PID file '%s': %s", fn, pa_cstrerror(errno));
315 pa_xfree(fn);
335 char *fn; local
345 if (!(fn = pa_runtime_path("pid")))
348 if ((fd = open_pid_file(fn, O_RDONLY)) < 0) {
356 if ((*pid = read_pid(fn, fd)) == (pid_t) -1)
386 pa_xfree(fn);