From efe50a30a6e599f863dd888844fea52d6b8f5adf Mon Sep 17 00:00:00 2001 From: "Nicholas J. Kain" Date: Mon, 11 Jul 2011 23:51:55 -0400 Subject: [PATCH] Even more cosmetic log message changes. --- ndhc/ifchange.c | 6 +++--- ndhc/leasefile.c | 6 +++--- ndhc/options.c | 16 ++++++++-------- ndhc/sys.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ndhc/ifchange.c b/ndhc/ifchange.c index f9a613b..5c9e586 100644 --- a/ndhc/ifchange.c +++ b/ndhc/ifchange.c @@ -169,7 +169,7 @@ void ifchange_deconfig(void) snprintf(buf, sizeof buf, "interface:%s:ip:0.0.0.0:", client_config.interface); - log_line("sent to ifchd: ip:0.0.0.0:"); + log_line("Sent to ifchd: ip:0.0.0.0:"); sockwrite(sockfd, buf, strlen(buf)); cfg_deconfig = 1; @@ -186,7 +186,7 @@ static size_t send_client_ip(char *out, size_t olen, struct dhcpmsg *packet) inet_ntop(AF_INET, &packet->yiaddr, ip, sizeof ip); snprintf(ipb, sizeof ipb, "ip:%s:", ip); strlcat(out, ipb, olen); - log_line("sent to ifchd: %s", ipb); + log_line("Sent to ifchd: %s", ipb); return strlen(ipb); } @@ -210,7 +210,7 @@ static size_t send_cmd(char *out, size_t olen, struct dhcpmsg *packet, if (ifchd_cmd(buf, sizeof buf, optdata, optlen, code) == -1) return 0; strlcat(out, buf, olen); - log_line("sent to ifchd: %s", buf); + log_line("Sent to ifchd: %s", buf); return strlen(buf); } diff --git a/ndhc/leasefile.c b/ndhc/leasefile.c index 4dc8d57..f20f761 100644 --- a/ndhc/leasefile.c +++ b/ndhc/leasefile.c @@ -46,7 +46,7 @@ void open_leasefile() if (strlen(leasefile) > 0) { leasefilefd = open(leasefile, O_WRONLY|O_TRUNC|O_CREAT, 0644); if (leasefilefd < 0) { - log_line("Failed to create lease file (%s)\n", leasefile); + log_line("Failed to create lease file (%s).", leasefile); exit(EXIT_FAILURE); } } @@ -67,13 +67,13 @@ void write_leasefile(struct in_addr ipnum) case -1: if (errno == EINTR) goto retry_trunc; - log_warning("Failed to truncate lease file.\n"); + log_warning("Failed to truncate lease file."); return; } lseek(leasefilefd, 0, SEEK_SET); ret = safe_write(leasefilefd, ip, strlen(ip)); if (ret == -1) - log_warning("Failed to write ip to lease file.\n"); + log_warning("Failed to write ip to lease file."); else fsync(leasefilefd); } diff --git a/ndhc/options.c b/ndhc/options.c index 4f4f71a..fcbe2dd 100644 --- a/ndhc/options.c +++ b/ndhc/options.c @@ -103,7 +103,7 @@ uint8_t option_length(uint8_t code) for (int i = 0; options[i].code; i++) if (options[i].code == code) return option_type_length(options[i].type & 0xf); - log_warning("option_length: unknown length for code 0x%02x", code); + log_warning("option_length: Unknown length for code 0x%02x.", code); return 0; } @@ -145,7 +145,7 @@ static uint8_t *do_get_option_data(uint8_t *buf, ssize_t buflen, int code, buflen -= buf[1] + 2; if (buflen < 0) { - log_warning("Bad dhcp data: option length would exceed options field length"); + log_warning("Bad option data: length would exceed options field size."); *optlen = 0; return NULL; } @@ -213,7 +213,7 @@ ssize_t get_end_option_idx(struct dhcpmsg *packet) if (packet->options[i] != DHCP_PADDING) i += packet->options[i+1] + 1; } - log_warning("get_end_option_idx(): did not find DHCP_END marker"); + log_warning("get_end_option_idx: Did not find DHCP_END marker."); return -1; } @@ -230,11 +230,11 @@ size_t add_option_string(struct dhcpmsg *packet, uint8_t code, char *str, ssize_t end = get_end_option_idx(packet); if (end == -1) { - log_warning("add_option_string: Buffer has no DHCP_END marker"); + log_warning("add_option_string: Buffer has no DHCP_END marker."); return 0; } if (end + len >= sizeof packet->options) { - log_warning("add_option_string: No space for option 0x%02x", code); + log_warning("add_option_string: No space for option 0x%02x.", code); return 0; } packet->options[end] = code; @@ -249,17 +249,17 @@ static ssize_t add_option_check(struct dhcpmsg *packet, uint8_t code, { size_t length = option_length(code); if (length != rlen) { - log_warning("add_u%01u_option: length mismatch code=0x%02x len=%01u", + log_warning("add_u%01u_option: Length mismatch: code=0x%02x len=%01u.", rlen*8, code, length); return -1; } ssize_t end = get_end_option_idx(packet); if (end == -1) { - log_warning("add_u%01u_option: Buffer has no DHCP_END marker", rlen*8); + log_warning("add_u%01u_option: Buffer has no DHCP_END marker.", rlen*8); return -1; } if (end + 2 + rlen >= sizeof packet->options) { - log_warning("add_u%01u_option: No space for option 0x%02x", + log_warning("add_u%01u_option: No space for option 0x%02x.", rlen*8, code); return -1; } diff --git a/ndhc/sys.c b/ndhc/sys.c index 9d9fbfc..aeeb3a9 100644 --- a/ndhc/sys.c +++ b/ndhc/sys.c @@ -66,7 +66,7 @@ void background(struct client_state_t *cs) setup_signals(cs); } if (file_exists(pidfile, "w") == -1) { - log_line("cannot open pidfile for write!"); + log_line("Cannot open pidfile for write!"); } else write_pid(pidfile); }