summaryrefslogtreecommitdiff
path: root/libexec/identd/parse.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-08-08 06:46:10 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-08-08 06:46:10 +0000
commit006c04bda615cb8e90d326298f6b88c89b73a45b (patch)
tree1a44e2440ad0ab2c89598317892c0e08a0f16097 /libexec/identd/parse.c
parentb6e5266a123aaff15c4cfcb56a719b5575053753 (diff)
do not use %m in syslog() when errno is known to be 0
Diffstat (limited to 'libexec/identd/parse.c')
-rw-r--r--libexec/identd/parse.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libexec/identd/parse.c b/libexec/identd/parse.c
index 7df3cc15020..21e89c5493c 100644
--- a/libexec/identd/parse.c
+++ b/libexec/identd/parse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.c,v 1.24 2001/04/16 00:26:21 fgsch Exp $ */
+/* $OpenBSD: parse.c,v 1.25 2001/08/08 06:46:09 deraadt Exp $ */
/*
* This program is in the public domain and may be used freely by anyone
@@ -213,7 +213,9 @@ parse(fd, laddr, faddr)
/* Read query from client */
if ((n = timed_read(fd, buf, sizeof(buf) - 1, IO_TIMEOUT)) <= 0) {
if (syslog_flag)
- syslog(LOG_NOTICE, "read from %s: %m", gethost(faddr));
+ syslog(LOG_NOTICE,
+ n ? "read from %s: %m" : "read from %s: EOF",
+ gethost(faddr));
n = snprintf(buf, sizeof(buf),
"%d , %d : ERROR : UNKNOWN-ERROR\r\n", lport, fport);
if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) {
@@ -381,7 +383,9 @@ parse6(fd, laddr, faddr)
/* Read query from client */
if ((n = timed_read(fd, buf, sizeof(buf) - 1, IO_TIMEOUT)) <= 0) {
if (syslog_flag)
- syslog(LOG_NOTICE, "read from %s: %m", gethost6(faddr));
+ syslog(LOG_NOTICE,
+ n ? "read from %s: %m" : "read from %s: EOF",
+ gethost6(faddr));
n = snprintf(buf, sizeof(buf),
"%d , %d : ERROR : UNKNOWN-ERROR\r\n", lport, fport);
if (timed_write(fd, buf, n, IO_TIMEOUT) != n && syslog_flag) {