* Then write the process ID. */
if (ftruncate(pidfile_fd, 0) == -1 ||
lseek(pidfile_fd, 0, SEEK_SET) == -1 ||
- dprintf(pidfile_fd, "%d\n", pidfile_pid) == -1)
+ dprintf(pidfile_fd, "%d\n", (int)pidfile_pid) == -1)
{
int error = errno;
if (cmd == RTM_DELADDR) {
if (state->addr == ia) {
loginfox("%s: pid %d deleted IP address %s",
- ifp->name, pid, ia->saddr);
+ ifp->name, (int)pid, ia->saddr);
dhcp_close(ifp);
state->addr = NULL;
/* Don't clear the added state as we need
if(pid == -1)
eloop_exit(ctx->eloop, EXIT_SUCCESS);
else if (++ctx->duid_len >= 100) { /* overload duid_len */
- logerrx("pid %d failed to exit", pid);
+ logerrx("pid %d failed to exit", (int)pid);
eloop_exit(ctx->eloop, EXIT_FAILURE);
} else
eloop_timeout_add_msec(ctx->eloop, 100,
if (sig != 0) {
pid = pidfile_read(ctx.pidfile);
if (pid != 0 && pid != -1)
- loginfox("sending signal %s to pid %d", siga, pid);
+ loginfox("sending signal %s to pid %d", siga, (int)pid);
if (pid == 0 || pid == -1 || kill(pid, sig) != 0) {
if (pid != 0 && pid != -1 && errno != ESRCH) {
logerr("kill");
if (sig == SIGHUP || sig == SIGUSR1)
goto exit_success;
/* Spin until it exits */
- loginfox("waiting for pid %d to exit", pid);
+ loginfox("waiting for pid %d to exit", (int)pid);
dhcpcd_pidfile_timeout(&ctx);
goto run_loop;
}
else
logerrx(PACKAGE
" already running on pid %d (%s)",
- pid, ctx.pidfile);
+ (int)pid, ctx.pidfile);
goto exit_failure;
}
}
/* We have now forked, setsid, forked once more.
* From this point on, we are the controlling daemon. */
- logdebugx("spawned manager process on PID %d", getpid());
+ logdebugx("spawned manager process on PID %d", (int)getpid());
start_manager:
ctx.options |= DHCPCD_STARTED;
if ((pid = pidfile_lock(ctx.pidfile)) != 0) {
- logerr("%s: pidfile_lock %d", __func__, pid);
+ logerr("%s: pidfile_lock %d", __func__, (int)pid);
#ifdef PRIVSEP
/* privsep has not started ... */
ctx.options &= ~DHCPCD_PRIVSEP;
IN_ARE_ADDR_EQUAL(&state->addr->addr, &ia->addr))
{
loginfox("%s: pid %d deleted IP address %s",
- ifp->name, pid, ia->saddr);
+ ifp->name, (int)pid, ia->saddr);
ipv4ll_defend_failed(ifp);
return ia;
}
if (cmd == RTM_DELADDR && ia->flags & IPV6_AF_ADDED)
logwarnx("%s: pid %d deleted address %s",
- ia->iface->name, pid, ia->saddr);
+ ia->iface->name, (int)pid, ia->saddr);
/* Check DAD.
* On Linux we can get IN6_IFF_DUPLICATED via RTM_DELADDR. */
pid = getpid();
else
pid = ctx->log_pid;
- if ((e = fprintf(stream, "[%d]", pid)) == -1)
+ if ((e = fprintf(stream, "[%d]", (int)pid)) == -1)
return -1;
len += e;
}
char buf[32];
rb_tree_remove_node(&ctx->routes, f);
- snprintf(buf, sizeof(buf), "pid %d deleted", pid);
+ snprintf(buf, sizeof(buf), "pid %d deleted", (int)pid);
rt_desc(LOG_WARNING, buf, f);
rt_free(f);
}
if (efprintf(fp, "PATH=%s",
path == NULL ? DEFAULT_PATH : path) == -1)
goto eexit;
- if (efprintf(fp, "pid=%d", getpid()) == -1)
+ if (efprintf(fp, "pid=%d", (int)getpid()) == -1)
goto eexit;
}