From b253cc42136649e3eac80e02667f8fbc1e43baaa Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 26 May 2005 12:23:44 +1000 Subject: - avsm@cvs.openbsd.org 2005/05/24 17:32:44 [atomicio.c atomicio.h authfd.c monitor_wrap.c msg.c scp.c sftp-client.c] [ssh-keyscan.c sshconnect.c] Switch atomicio to use a simpler interface; it now returns a size_t (containing number of bytes read/written), and indicates error by returning 0. EOF is signalled by errno==EPIPE. Typical use now becomes: if (atomicio(read, ..., len) != len) err(1,"read"); ok deraadt@, cloder@, djm@ --- authfd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'authfd.c') diff --git a/authfd.c b/authfd.c index 662350cef..9ce5b5ea8 100644 --- a/authfd.c +++ b/authfd.c @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: authfd.c,v 1.64 2004/08/11 21:44:31 avsm Exp $"); +RCSID("$OpenBSD: authfd.c,v 1.65 2005/05/24 17:32:43 avsm Exp $"); #include @@ -149,8 +149,7 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply l = len; if (l > sizeof(buf)) l = sizeof(buf); - l = atomicio(read, auth->fd, buf, l); - if (l <= 0) { + if (atomicio(read, auth->fd, buf, l) != l) { error("Error reading response from authentication socket."); return 0; } -- cgit v1.2.3