note("bound to %s -- renewal in %ld seconds.",
piaddr(ip->client->active->address),
- ip->client->active->renewal - cur_time);
+ (long int)(ip->client->active->renewal - cur_time));
ip->client->state = S_BOUND;
note("DHCPDISCOVER on %s to %s port %d interval %ld",
ip->name, inet_ntoa(sockaddr_broadcast.sin_addr),
- ntohs(sockaddr_broadcast.sin_port), ip->client->interval);
+ ntohs(sockaddr_broadcast.sin_port), (long int)ip->client->interval);
/* Send out a packet. */
(void)send_packet(ip, &ip->client->packet, ip->client->packet_length,
ip->client->active->renewal) {
ip->client->state = S_BOUND;
note("bound: renewal in %ld seconds.",
- ip->client->active->renewal -
- cur_time);
+ (long int)(ip->client->active->renewal -
+ cur_time));
add_timeout(
ip->client->active->renewal,
state_bound, ip);
if (!leaseFile) {
leaseFile = fopen(path_dhclient_db, "w");
if (!leaseFile)
- error("can't create %s: %m", path_dhclient_db);
+ error("can't create %s: %s", path_dhclient_db, strerror(errno));
} else {
fflush(leaseFile);
rewind(leaseFile);
if (!leaseFile) { /* XXX */
leaseFile = fopen(path_dhclient_db, "w");
if (!leaseFile)
- error("can't create %s: %m", path_dhclient_db);
+ error("can't create %s: %s", path_dhclient_db, strerror(errno));
}
fprintf(leaseFile, "lease {\n");
sizeof(size_t) + strlen(reason);
if ((buf = buf_open(hdr.len)) == NULL)
- error("buf_open: %m");
+ error("buf_open: %s", strerror(errno));
errs = 0;
errs += buf_add(buf, &hdr, sizeof(hdr));
errs += buf_add(buf, reason, len);
if (errs)
- error("buf_add: %m");
+ error("buf_add: %s", strerror(errno));
if (buf_close(privfd, buf) == -1)
- error("buf_close: %m");
+ error("buf_close: %s", strerror(errno));
}
void
scripttime = time(NULL);
if ((buf = buf_open(hdr.len)) == NULL)
- error("buf_open: %m");
+ error("buf_open: %s", strerror(errno));
errs = 0;
errs += buf_add(buf, &hdr, sizeof(hdr));
}
if (errs)
- error("buf_add: %m");
+ error("buf_add: %s", strerror(errno));
if (buf_close(privfd, buf) == -1)
- error("buf_close: %m");
+ error("buf_close: %s", strerror(errno));
}
int