diff options
author | Damien Miller <djm@mindrot.org> | 2005-05-26 04:23:44 +0200 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2005-05-26 04:23:44 +0200 |
commit | b253cc42136649e3eac80e02667f8fbc1e43baaa (patch) | |
tree | e3824a905c7b12e4901e60e87ecdc968228e645e /atomicio.h | |
parent | - avsm@cvs.openbsd.org 2005/05/24 02:05:09 (diff) | |
download | openssh-b253cc42136649e3eac80e02667f8fbc1e43baaa.tar.xz openssh-b253cc42136649e3eac80e02667f8fbc1e43baaa.zip |
- 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@
Diffstat (limited to 'atomicio.h')
-rw-r--r-- | atomicio.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/atomicio.h b/atomicio.h index 5c0f392ef..7eccf206b 100644 --- a/atomicio.h +++ b/atomicio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atomicio.h,v 1.5 2003/06/28 16:23:06 deraadt Exp $ */ +/* $OpenBSD: atomicio.h,v 1.6 2005/05/24 17:32:43 avsm Exp $ */ /* * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. @@ -28,6 +28,6 @@ /* * Ensure all of data on socket comes through. f==read || f==vwrite */ -ssize_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t); +size_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t); #define vwrite (ssize_t (*)(int, void *, size_t))write |