diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2005-10-07 13:19:41 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2005-10-07 13:19:41 +0000 |
commit | d39ca6ebd673875eb5f3301d7344c443447a9873 (patch) | |
tree | fc6e92c086042aaa3719c3343da6bd2662fcb9ee | |
parent | a981381fb12bb416c36b3be78d02e3e6c746cb23 (diff) |
Don't display errno message when errno isn't set.
Okay deraadt@, moritz@, help and okay henning@
-rw-r--r-- | sbin/dhclient/privsep.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sbin/dhclient/privsep.c b/sbin/dhclient/privsep.c index e3ccdf64ecf..2ae9a3bd6f1 100644 --- a/sbin/dhclient/privsep.c +++ b/sbin/dhclient/privsep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: privsep.c,v 1.11 2005/08/08 14:33:46 moritz Exp $ */ +/* $OpenBSD: privsep.c,v 1.12 2005/10/07 13:19:40 pedro Exp $ */ /* * Copyright (c) 2004 Henning Brauer <henning@openbsd.org> @@ -55,10 +55,8 @@ buf_close(int sock, struct buf *buf) do { n = write(sock, buf->buf + buf->rpos, buf->size - buf->rpos); - if (n == 0) { /* connection closed */ - errno = 0; - error("buf_close (connection closed): %m"); - } + if (n == 0) /* connection closed */ + error("buf_close (connection closed)"); if (n != -1 && n < buf->size - buf->rpos) error("buf_close (short write): %m"); @@ -78,8 +76,8 @@ buf_read(int sock, void *buf, size_t nbytes) do { n = read(sock, buf, nbytes); - if (n == 0) - error("buf_read (connection closed): %m"); + if (n == 0) /* connection closed */ + error("buf_read (connection closed)"); if (n != -1 && n < nbytes) error("buf_read (short read): %m"); } while (n == -1 && (errno == EINTR || errno == EAGAIN)); |