summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gunnarsson <andreas@cvs.openbsd.org>2009-06-12 20:43:23 +0000
committerAndreas Gunnarsson <andreas@cvs.openbsd.org>2009-06-12 20:43:23 +0000
commit5645ee5687fb902d86bdcab2b1b19b6ed4896633 (patch)
tree91301d0ff22680b59722808e52d3a05ee5b8247f
parentea6bd7b6f8339dac1de544c76eab804cb8594a67 (diff)
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.c3
-rw-r--r--usr.bin/ssh/packet.c4
-rw-r--r--usr.bin/ssh/roaming.h2
-rw-r--r--usr.bin/ssh/roaming_common.c15
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;