summaryrefslogtreecommitdiffstats
path: root/usr.bin/logger
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>2005-05-29 16:04:46 +0000
committercharnier <charnier@FreeBSD.org>2005-05-29 16:04:46 +0000
commit6cd34f4d9001c2e01f74f8d878d1e81e77ea4cce (patch)
treefa388e3298b5e5e075fecbef0a1b25715fcfc6aa /usr.bin/logger
parentdb28e8fe5e489a9cb9d8dcde2ccefafb3c1eb0a2 (diff)
downloadFreeBSD-src-6cd34f4d9001c2e01f74f8d878d1e81e77ea4cce.zip
FreeBSD-src-6cd34f4d9001c2e01f74f8d878d1e81e77ea4cce.tar.gz
Reduce compiler warning: variable might be used uninitialized, by giving
an initial value.
Diffstat (limited to 'usr.bin/logger')
-rw-r--r--usr.bin/logger/logger.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/logger/logger.c b/usr.bin/logger/logger.c
index 3832752..4566506 100644
--- a/usr.bin/logger/logger.c
+++ b/usr.bin/logger/logger.c
@@ -37,11 +37,12 @@ static const char copyright[] =
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
-#ifndef lint
#if 0
+#ifndef lint
static char sccsid[] = "@(#)logger.c 8.1 (Berkeley) 6/6/93";
-#endif
#endif /* not lint */
+#endif
+
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
@@ -190,7 +191,7 @@ logmessage(int pri, char *host, char *buf)
hints.ai_socktype = SOCK_DGRAM;
error = getaddrinfo(host, "syslog", &hints, &res);
if (error == EAI_SERVICE) {
- warnx ("syslog/udp: unknown service"); /* not fatal */
+ warnx("syslog/udp: unknown service"); /* not fatal */
error = getaddrinfo(host, "514", &hints, &res);
}
if (error)
@@ -217,6 +218,7 @@ logmessage(int pri, char *host, char *buf)
if ((len = asprintf(&line, "<%d>%s", pri, buf)) == -1)
errx(1, "asprintf");
+ lsent = -1;
for (i = 0; i < nsock; ++i) {
lsent = sendto(socks[i].sock, line, len, 0,
(struct sockaddr *)&socks[i].addr,
OpenPOWER on IntegriCloud