From 674a60748884dc55ee7091b7c23a41240e75f73c Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Tue, 1 Jun 2004 02:46:09 +0000 Subject: Makefile.in contains updated files required --HG-- extra : convert_revision : cc8a8c49dc70e632c352853a39801089b08149be --- atomicio.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 atomicio.c (limited to 'atomicio.c') diff --git a/atomicio.c b/atomicio.c new file mode 100644 index 0000000..5b0b393 --- /dev/null +++ b/atomicio.c @@ -0,0 +1,64 @@ +/* + * Copied from OpenSSH 3.6.1p2, required for loginrec.c + * + * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* Taken from OpenSSH for use with the loginrec code */ + +/* RCSID("$OpenBSD: atomicio.c,v 1.10 2001/05/08 22:48:07 markus Exp $"); */ + +#include "atomicio.h" + +/* + * ensure all of data on socket comes through. f==read || f==write + */ +ssize_t +atomicio(f, fd, _s, n) + ssize_t (*f) (); + int fd; + void *_s; + size_t n; +{ + char *s = _s; + ssize_t res, pos = 0; + + while (n > pos) { + res = (f) (fd, s + pos, n - pos); + switch (res) { + case -1: +#ifdef EWOULDBLOCK + if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK) +#else + if (errno == EINTR || errno == EAGAIN) +#endif + continue; + case 0: + return (res); + default: + pos += res; + } + } + return (pos); +} -- cgit v1.2.3 From 225452befcf83a7ed8923b96a285cb102c82f1a6 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Fri, 30 Jul 2004 11:27:52 +0000 Subject: get rid of the substitution... We want a fixed identifier --HG-- extra : convert_revision : d6b70dbcc1713663608033cb41cde196d44d4f2c --- atomicio.c | 2 +- loginrec.c | 1 - loginrec.h | 2 +- progressmeter.c | 2 +- scpmisc.c | 4 ++-- sshpty.c | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) (limited to 'atomicio.c') diff --git a/atomicio.c b/atomicio.c index 5b0b393..db2c2ba 100644 --- a/atomicio.c +++ b/atomicio.c @@ -27,7 +27,7 @@ /* Taken from OpenSSH for use with the loginrec code */ -/* RCSID("$OpenBSD: atomicio.c,v 1.10 2001/05/08 22:48:07 markus Exp $"); */ +/* RCSID("OpenBSD: atomicio.c,v 1.10 2001/05/08 22:48:07 markus Exp "); */ #include "atomicio.h" diff --git a/loginrec.c b/loginrec.c index 5ec0bc1..7a9c480 100644 --- a/loginrec.c +++ b/loginrec.c @@ -150,7 +150,6 @@ ** **/ -/*RCSID("$Id: loginrec.c,v 1.2 2004/05/04 10:17:43 matt Exp $");*/ #include "includes.h" #include "loginrec.h" diff --git a/loginrec.h b/loginrec.h index 3141b10..f253fa6 100644 --- a/loginrec.h +++ b/loginrec.h @@ -31,7 +31,7 @@ #include "includes.h" -/* RCSID("$Id: loginrec.h,v 1.2 2004/05/04 10:17:43 matt Exp $"); */ +/* RCSID("Id: loginrec.h,v 1.2 2004/05/04 10:17:43 matt Exp "); */ /* The following #defines are from OpenSSH's defines.h, required for loginrec */ diff --git a/progressmeter.c b/progressmeter.c index 39e8a77..0d856cb 100644 --- a/progressmeter.c +++ b/progressmeter.c @@ -24,7 +24,7 @@ */ #include "includes.h" -/*RCSID("$OpenBSD: progressmeter.c,v 1.15 2003/08/31 12:14:22 markus Exp $");*/ +/*RCSID("OpenBSD: progressmeter.c,v 1.15 2003/08/31 12:14:22 markus Exp ");*/ #include "progressmeter.h" #include "atomicio.h" diff --git a/scpmisc.c b/scpmisc.c index 2d37753..e15bf4d 100644 --- a/scpmisc.c +++ b/scpmisc.c @@ -22,7 +22,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*RCSID("$OpenBSD: misc.c,v 1.22 2003/09/18 08:49:45 markus Exp $");*/ +/*RCSID("OpenBSD: misc.c,v 1.22 2003/09/18 08:49:45 markus Exp ");*/ /* For xmalloc, xfree etc: * Author: Tatu Ylonen @@ -38,7 +38,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/*RCSID("$OpenBSD: xmalloc.c,v 1.16 2001/07/23 18:21:46 stevesk Exp $");*/ +/*RCSID("OpenBSD: xmalloc.c,v 1.16 2001/07/23 18:21:46 stevesk Exp ");*/ #include "includes.h" #include "scpmisc.h" diff --git a/sshpty.c b/sshpty.c index 799a92c..3526ff0 100644 --- a/sshpty.c +++ b/sshpty.c @@ -15,7 +15,7 @@ * called by a name other than "ssh" or "Secure Shell". */ -/*RCSID("$OpenBSD: sshpty.c,v 1.7 2002/06/24 17:57:20 deraadt Exp $");*/ +/*RCSID("OpenBSD: sshpty.c,v 1.7 2002/06/24 17:57:20 deraadt Exp ");*/ #include "includes.h" #include "dbutil.h" -- cgit v1.2.3 From 27aa148e02008a05e135079342b8d33a9647acad Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Sun, 19 Dec 2004 07:43:37 +0000 Subject: atomicio.c: one less compile warning --HG-- extra : convert_revision : 25808b4e64822230283602dee93b85d9d4fa6507 --- atomicio.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'atomicio.c') diff --git a/atomicio.c b/atomicio.c index db2c2ba..1915a7b 100644 --- a/atomicio.c +++ b/atomicio.c @@ -1,5 +1,5 @@ /* - * Copied from OpenSSH 3.6.1p2, required for loginrec.c + * Copied from OpenSSH 3.6.1p2. * * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. * All rights reserved. @@ -25,8 +25,6 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* Taken from OpenSSH for use with the loginrec code */ - /* RCSID("OpenBSD: atomicio.c,v 1.10 2001/05/08 22:48:07 markus Exp "); */ #include "atomicio.h" @@ -42,7 +40,8 @@ atomicio(f, fd, _s, n) size_t n; { char *s = _s; - ssize_t res, pos = 0; + ssize_t res; + size_t pos = 0; while (n > pos) { res = (f) (fd, s + pos, n - pos); -- cgit v1.2.3