summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/scp.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1999-12-06 20:15:25 +0000
committerderaadt <deraadt@openbsd.org>1999-12-06 20:15:25 +0000
commitb84216c7e43a571d4035d416ad49dc5b0ece3d3e (patch)
treeb5406030cc4979108efea77feefe93306882908a /usr.bin/ssh/scp.c
parentRegen. (diff)
downloadwireguard-openbsd-b84216c7e43a571d4035d416ad49dc5b0ece3d3e.tar.xz
wireguard-openbsd-b84216c7e43a571d4035d416ad49dc5b0ece3d3e.zip
move atomicio into it's own file. wrap all socket write()s which were doing
write(sock, buf, len) != len, with atomicio() calls.
Diffstat (limited to 'usr.bin/ssh/scp.c')
-rw-r--r--usr.bin/ssh/scp.c28
1 files changed, 2 insertions, 26 deletions
diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c
index 39a371dfcfc..51cb2eb5409 100644
--- a/usr.bin/ssh/scp.c
+++ b/usr.bin/ssh/scp.c
@@ -45,7 +45,7 @@
*/
#include "includes.h"
-RCSID("$Id: scp.c,v 1.21 1999/11/24 20:26:35 markus Exp $");
+RCSID("$Id: scp.c,v 1.22 1999/12/06 20:15:28 deraadt Exp $");
#include "ssh.h"
#include "xmalloc.h"
@@ -974,7 +974,7 @@ run_err(const char *fmt,...)
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: scp.c,v 1.21 1999/11/24 20:26:35 markus Exp $
+ * $Id: scp.c,v 1.22 1999/12/06 20:15:28 deraadt Exp $
*/
char *
@@ -1065,30 +1065,6 @@ lostconn(signo)
exit(1);
}
-/*
- * ensure all of data on socket comes through. f==read || f==write
- */
-int
-atomicio(f, fd, s, n)
- int (*f) ();
- char *s;
-{
- int res, pos = 0;
-
- while (n > pos) {
- res = (f) (fd, s + pos, n - pos);
- switch (res) {
- case -1:
- if (errno == EINTR || errno == EAGAIN)
- continue;
- case 0:
- return (res);
- default:
- pos += res;
- }
- }
- return (pos);
-}
void
alarmtimer(int wait)