Mercurial > dropbear
comparison atomicio.c @ 140:1bb50993acf1
atomicio.c: one less compile warning
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sun, 19 Dec 2004 07:43:37 +0000 |
parents | 5c6f9d27ea1c |
children | 968be6f7cff6 |
comparison
equal
deleted
inserted
replaced
137:a3b58707122b | 140:1bb50993acf1 |
---|---|
1 /* | 1 /* |
2 * Copied from OpenSSH 3.6.1p2, required for loginrec.c | 2 * Copied from OpenSSH 3.6.1p2. |
3 * | 3 * |
4 * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. | 4 * Copyright (c) 1995,1999 Theo de Raadt. All rights reserved. |
5 * All rights reserved. | 5 * All rights reserved. |
6 * | 6 * |
7 * Redistribution and use in source and binary forms, with or without | 7 * Redistribution and use in source and binary forms, with or without |
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 */ | 26 */ |
27 | 27 |
28 /* Taken from OpenSSH for use with the loginrec code */ | |
29 | |
30 /* RCSID("OpenBSD: atomicio.c,v 1.10 2001/05/08 22:48:07 markus Exp "); */ | 28 /* RCSID("OpenBSD: atomicio.c,v 1.10 2001/05/08 22:48:07 markus Exp "); */ |
31 | 29 |
32 #include "atomicio.h" | 30 #include "atomicio.h" |
33 | 31 |
34 /* | 32 /* |
40 int fd; | 38 int fd; |
41 void *_s; | 39 void *_s; |
42 size_t n; | 40 size_t n; |
43 { | 41 { |
44 char *s = _s; | 42 char *s = _s; |
45 ssize_t res, pos = 0; | 43 ssize_t res; |
44 size_t pos = 0; | |
46 | 45 |
47 while (n > pos) { | 46 while (n > pos) { |
48 res = (f) (fd, s + pos, n - pos); | 47 res = (f) (fd, s + pos, n - pos); |
49 switch (res) { | 48 switch (res) { |
50 case -1: | 49 case -1: |