diff options
author | 2009-06-12 20:43:22 +0000 | |
---|---|---|
committer | 2009-06-12 20:43:22 +0000 | |
commit | d07c367cf49eb448d94bac8b4b87e7210e41ad94 (patch) | |
tree | a598a354661d59d84beb745fa9b89ff6a46824ea | |
parent | state_panic() tries the active then other valid leases by setting the (diff) | |
download | wireguard-openbsd-d07c367cf49eb448d94bac8b4b87e7210e41ad94.tar.xz wireguard-openbsd-d07c367cf49eb448d94bac8b4b87e7210e41ad94.zip |
Fix warnings found by chl@ and djm@ and change roaming_atomicio's
return type to match atomicio's
Diff from djm@, ok markus@
-rw-r--r-- | usr.bin/ssh/monitor.c | 3 | ||||
-rw-r--r-- | usr.bin/ssh/packet.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/roaming.h | 2 | ||||
-rw-r--r-- | usr.bin/ssh/roaming_common.c | 15 |
4 files changed, 13 insertions, 11 deletions
diff --git a/usr.bin/ssh/monitor.c b/usr.bin/ssh/monitor.c index 2d03b327922..80a66375f6e 100644 --- a/usr.bin/ssh/monitor.c +++ b/usr.bin/ssh/monitor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor.c,v 1.103 2009/05/28 16:50:16 andreas Exp $ */ +/* $OpenBSD: monitor.c,v 1.104 2009/06/12 20:43:22 andreas Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * Copyright 2002 Markus Friedl <markus@openbsd.org> @@ -73,6 +73,7 @@ #include "compat.h" #include "ssh2.h" #include "jpake.h" +#include "roaming.h" #ifdef GSSAPI static Gssctxt *gsscontext = NULL; diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index 52392fbc8f4..27342e49857 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.163 2009/05/28 16:50:16 andreas Exp $ */ +/* $OpenBSD: packet.c,v 1.164 2009/06/12 20:43:22 andreas Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -184,7 +184,7 @@ struct session_state { static struct session_state *active_state; static struct session_state * -alloc_session_state() +alloc_session_state(void) { struct session_state *s = xcalloc(1, sizeof(*s)); diff --git a/usr.bin/ssh/roaming.h b/usr.bin/ssh/roaming.h index 88193453a87..2bbc8a09fcd 100644 --- a/usr.bin/ssh/roaming.h +++ b/usr.bin/ssh/roaming.h @@ -22,7 +22,7 @@ extern int resume_in_progress; void add_recv_bytes(u_int64_t); ssize_t roaming_write(int, const void *, size_t, int *); ssize_t roaming_read(int, void *, size_t, int *); -ssize_t roaming_atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t); +size_t roaming_atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t); u_int64_t get_recv_bytes(void); u_int64_t get_sent_bytes(void); void roam_set_bytes(u_int64_t, u_int64_t); diff --git a/usr.bin/ssh/roaming_common.c b/usr.bin/ssh/roaming_common.c index 5a871b23e52..3df55df15e8 100644 --- a/usr.bin/ssh/roaming_common.c +++ b/usr.bin/ssh/roaming_common.c @@ -55,9 +55,9 @@ get_sent_bytes(void) } void -roam_set_bytes(u_int64_t sent, u_int64_t recv) +roam_set_bytes(u_int64_t sent, u_int64_t recvd) { - read_bytes = recv; + read_bytes = recvd; write_bytes = sent; } @@ -70,7 +70,7 @@ roaming_write(int fd, const void *buf, size_t count, int *cont) if (ret > 0 && !resume_in_progress) { write_bytes += ret; } - debug("Wrote %d bytes for a total of %lld", ret, write_bytes); + debug("Wrote %ld bytes for a total of %lld", (long)ret, write_bytes); return ret; } @@ -86,12 +86,13 @@ roaming_read(int fd, void *buf, size_t count, int *cont) return ret; } -ssize_t -roaming_atomicio(ssize_t(*f)(), int fd, void *buf, size_t count) +size_t +roaming_atomicio(ssize_t(*f)(int, void*, size_t), int fd, void *buf, + size_t count) { - ssize_t ret = atomicio(f, fd, buf, count); + size_t ret = atomicio(f, fd, buf, count); - if ((f == write || f == vwrite) && ret > 0 && !resume_in_progress) { + if (f == vwrite && ret > 0 && !resume_in_progress) { write_bytes += ret; } else if (f == read && ret > 0 && !resume_in_progress) { read_bytes += ret; |