pidfile
char *buf, *mstr, **pargv, *p, *q, *pidfile;
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);
pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
pidfile(NULL);
pidfile (NULL);
pidfile (NULL);
pidfile() = default;
pidfile(pidfile &&other) : pfh(other.release()) {}
pidfile(pidfile const &) = delete;
pidfile &operator=(pidfile &&other) noexcept
pidfile &operator=(pidfile const &) = delete;
pidfile &operator=(struct pidfh *newpfh)
freebsd::pidfile pf(pfh);
const char *pidfile;
pidfile = NULL;
pidfile = optarg;
if (pidfile != NULL) {
if ((fp = fopen(pidfile, "w")) == NULL) {
perror(pidfile);
if (pidfile)
remove(pidfile);
f = fopen(pidfile, "r");
unlink(pidfile);
f = fopen(pidfile, "r");
unlink(pidfile);
pfh = pidfile_open(pidfile, 0644, NULL);
static const char pidfile[] = "tftpd.pid";
struct pidfh *pidfile;
if (pidfile != NULL) {
pidfile_write(pidfile);
if (caph_rights_limit(pidfile_fileno(pidfile), &rights) < 0)
if (pidfile != NULL)
pidfile_remove(pidfile);
pidfile = pidfile_open(path_dhclient_pidfile, 0644, &otherpid);
if (pidfile == NULL) {
if (pidfile != NULL)
pidfile_write(pidfile);
extern struct pidfh *pidfile;
if (pidfile != NULL)
pidfile_remove(pidfile);
pidfile = optarg;
if (pidfile != NULL) {
if (strlcpy(cfg->hc_pidfile, pidfile,
if (pidfile != NULL || !foreground) {
if (pidfile != NULL || !foreground) {
if (!foreground && pidfile == NULL &&
static const char *pidfile;
static char *pidfile = "/etc/opt/ipf/ipmon.pid";
static char *pidfile = "/var/run/ipmon.pid";
pidfile = optarg;
write_pid(pidfile);
FILE *pidfile;
pidfile = fopen("pidfile", "r");
if (pidfile == NULL && errno == ENOENT) {
ATF_REQUIRE_MSG(NULL != pidfile, "fopen: %s", strerror(errno));
ATF_REQUIRE_EQ(1, fscanf(pidfile, "%d", &testpid));
fclose(pidfile);
FILE *pidfile;
pidfile = fopen("pidfile", "w");
ATF_REQUIRE_MSG(NULL != pidfile, "fopen: %s", strerror(errno));
fprintf(pidfile, "%d", pid);
fclose(pidfile);
const char *pidfile = NULL;
pidfile = optarg;
if (pidfile != NULL) {
pfh = pidfile_open(pidfile, 0600, &otherpid);
pidfile = optarg;
fp = open(pidfile, O_WRONLY|O_CREAT, S_IRUSR|S_IRGRP|S_IROTH);
err(1, "%s", pidfile);
err(1, "%s", pidfile);
static const char * pidfile = "/var/run/usbaction.pid";
snprintf(pidfile, sizeof(pidfile), "%s/%s.pid",
chan->pfh = pidfile_open(pidfile, 0600, NULL);
char pidfile[PATH_MAX];
const char *pidfile = PIDDIR PIDFILE;
pfh = pidfile_open(pidfile, 0600, &otherpid);
"can't open or create %s: %s", pidfile,
freebsd::pidfile conf_pidfile;
pidfile: PIDFILE STR
pidfile
perror(pidfile);
strcpy(pidfile, optarg);
static char pidfile[MAXPATHLEN];
(void) unlink(pidfile);
if (pidfile[0] == '\0') {
snprintf(pidfile, sizeof pidfile,
fd = open(pidfile, O_WRONLY|O_CREAT|O_EXCL, 0644);
perror(pidfile);
static const char *pidfile = "/var/run/moused.pid";
pidfile = optarg;
pfh = pidfile_open(pidfile, 0600, &mpid);
static const char *pidfile = "/var/run/msconvd.pid";
pidfile = optarg;
pfh = pidfile_open(pidfile, 0600, &mpid);
struct pidfh *pidfile;
pidfile = pidfile_open(DEFAULT_PIDFILE_PATH, 0644, &pid);
if (pidfile == NULL) {
pidfile_remove(pidfile);
pidfile_write(pidfile);
pidfile_remove(pidfile);
const char *pidfile = NULL;
pidfile = optarg;
pfh = pidfile_open(pidfile, 0600, &otherpid);
char pidfile[PATH_MAX];
snprintf(pidfile, sizeof pidfile, "%stun%d.pid", _PATH_VARRUN, bundle->unit);
lockfile = ID0fopen(pidfile, "w");
pidfile, strerror(errno));
char pidfile[PATH_MAX];
snprintf(pidfile, sizeof pidfile, "%stun%d.pid", _PATH_VARRUN, bundle->unit);
ID0unlink(pidfile);
pidfile = pidfile_buf;
if (pidfile == NULL && ifname != NULL && aflag == 0) {
pidfile = pidfile_buf;
pidfile_fh = pidfile_open(pidfile, 0600, NULL);
(pidfile == NULL) ? "/var/run/rarpd.pid" : pidfile);
static char *pidfile;
const char *pidfile = ROUTE6D_PID;
pidfile = optarg;
if ((pidfh = fopen(pidfile, "w")) != NULL) {
char pidfile[128];
snprintf(ctx->pidfile, 127, PIDFILE, ctx->ifnam);
pfh = pidfile_open(ctx->pidfile, 0600, &opid);
warn("Cannot create pidfile %s", ctx->pidfile);
char pidfile[128];
snprintf(pidfile, 127, PIDFILE, ifnam);
fp = fopen(pidfile, "r");
warn("Cannot open %s", pidfile);
int pidfile = open(voss_pid_path, O_RDWR | O_CREAT | O_TRUNC, 0600);
if (pidfile < 0)
if (write(pidfile, mypidstr, strlen(mypidstr)) !=
close(pidfile);
pfh = pidfile_open(pidfile, 0600, &otherpid);
pidfile = optarg;
static const char *pidfile = _PATH_VARRUN "watchdogd.pid";