Lines Matching refs:pid_fd
310 write_pid(ctx->pid_fd, pid);
311 close(ctx->pid_fd);
312 ctx->pid_fd = -1;
1479 ctx.pid_fd = ctx.control_fd = ctx.control_unpriv_fd = ctx.link_fd = -1;
1797 ctx.pid_fd = open(ctx.pidfile, opt, 0664);
1798 if (ctx.pid_fd == -1)
1804 if (flock(ctx.pid_fd, LOCK_EX | LOCK_NB) == -1) {
1806 close(ctx.pid_fd);
1807 ctx.pid_fd = -1;
1812 if (fcntl(ctx.pid_fd, F_GETFD, &opt) == -1 ||
1813 fcntl(ctx.pid_fd, F_SETFD, opt | FD_CLOEXEC) == -1)
1816 close(ctx.pid_fd);
1817 ctx.pid_fd = -1;
1821 write_pid(ctx.pid_fd, getpid());
1987 if (ctx.pid_fd != -1) {
1988 close(ctx.pid_fd);