Lines Matching refs:fn

51 static pid_t read_pid(const char *fn, int fd) {
56 pa_assert(fn);
60 pa_log_warn("Failed to read PID file '%s': %s", fn, pa_cstrerror(errno));
72 pa_log_warn("Failed to parse PID file '%s'", fn);
80 static int open_pid_file(const char *fn, int mode) {
83 pa_assert(fn);
88 if ((fd = pa_open_cloexec(fn, mode
95 pa_log_warn("Failed to open PID file '%s': %s", fn, pa_cstrerror(errno));
104 pa_log_warn("Failed to fstat() PID file '%s': %s", fn, pa_cstrerror(errno));
116 pa_log_warn("Failed to close file '%s': %s", fn, pa_cstrerror(errno));
191 char *fn;
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;
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;
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);