pidfile
pidfile(pidf);
n = snprintf(pidfile, sizeof(pidfile), "%s/%s", PATH_PIDFILE, ipsrc);
if (n < 0 || (u_int)n >= sizeof(pidfile)) {
if ((pidfd = open(pidfile, O_RDWR|O_CREAT, 0644)) == -1 ||
syslog(LOG_ERR, "cannot open or create %s: %s", pidfile,
pidfile, otherpid, strerror(save_errno));
char pidfile[MAXPATHLEN]; /* we save pid in this file. */
if (pidfile[0] && (pidfp != NULL))
if (unlink(pidfile) == -1)
syslog(LOG_ERR, "cannot unlink %s (%m)", pidfile);
int pidfile(const char *);
if (pidfile(NULL) == -1)
httpd->pidfile = bozostrdup(httpd, NULL, cp);
free(httpd->pidfile);
char *pidfile; /* path to the pid file, if any */
if (httpd->pidfile == NULL)
if ((file = fopen(httpd->pidfile, "w")) == NULL)
httpd->pidfile);
pidfile_path = httpd->pidfile;
pidfile("lfs_cleanerd");
pidfile(pidname);
pidfile(NULL);
pidfile(NULL);
if (pidfile(NULL) == -1)
if (pidfile("custom-basename") == -1)
if (pidfile(path) == -1)
if (pidfile(NULL) == -1)
if (pidfile(NULL) == -1)
if (pidfile("custom-basename") == -1)
if (pidfile("custom-basename") == -1)
if (pidfile("./var/run/first.pid") == -1)
if (pidfile("./second.pid") == -1)
if (pidfile(NULL) == -1)
if (pidfile("./second.pid") == -1)
if (pidfile("custom-basename") == -1)
if (pidfile(path_pid) != 0) {
pidfile = getenv("BTHSET_PIDFILE");
pidfile = optarg;
err(EXIT_FAILURE, "%s", pidfile);
if (pidfile == NULL)
unlink(pidfile);
if (pidfile == NULL)
fd = open(pidfile, O_WRONLY | O_CREAT | O_TRUNC, 0644);
static char *pidfile; /* PID file name */
char pidfile[MAXPATHLEN]; /* File containing PID to signal */
(void)strlcpy(log->pidfile, *ap++, sizeof(log->pidfile));
log->pidfile[0] = '\0';
if (log->pidfile[0] != '\0')
pid = readpidfile(log->pidfile);
char buf[_POSIX2_LINE_MAX], **pargv, *q, *pidfile = NULL;
pidfile = optarg;
if (pidfile != NULL)
pidfromfile = takepid(pidfile, pidfilelock);
takepid(const char *pidfile, int pidfilelock)
fh = fopen(pidfile, "r");
err(STATUS_ERROR, "Cannot open pidfile `%s'", pidfile);
errx(STATUS_ERROR, "File '%s' can be locked", pidfile);
"Error while locking file '%s'", pidfile);
errx(STATUS_ERROR, "Pidfile `%s' is empty", pidfile);
err(STATUS_ERROR, "Cannot read from pid file `%s'", pidfile);
errx(STATUS_ERROR, "Invalid pid in file `%s'", pidfile);
errx(STATUS_ERROR, "Invalid pid in file `%s'", pidfile);
(void)pidfile(pidfn);
pidfile(NULL);
pidfile(NULL);
if (pidfile(NULL) == -1) {
if (pidfile(NULL) == -1) {
pidfile(NULL);
if (ptr == NULL || pidfile(ptr) < 0)
if (detach && pidfile(NULL) < 0) {
if (pidfile(ifr.ifr_name) == -1)
pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
static const char *pidfile = "/var/run/moused.pid";
pidfile = optarg;
fp = fopen(pidfile, "w");
pidfile(NULL);
pidfile(pidname);
(void)pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
(void)pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
(void)pidfile(NULL);
pidfile(NULL);
if (pidfile(NULL)) {
pidfile(NULL);
pidfile(NULL);
if (pidfile(Pid_File) == -1)
(void)pidfile(NULL);
(void)pidfile(NULL);