Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/rump/net/lib/libsockin few more conversions
details: https://anonhg.NetBSD.org/src/rev/47bbab1bf0ce
branches: trunk
changeset: 786494:47bbab1bf0ce
user: pooka <pooka%NetBSD.org@localhost>
date: Tue Apr 30 00:12:35 2013 +0000
description:
few more conversions
diffstat:
sys/rump/net/lib/libsockin/sockin.c | 21 ++++++++++-----------
1 files changed, 10 insertions(+), 11 deletions(-)
diffs (70 lines):
diff -r 9bf9f7efbfca -r 47bbab1bf0ce sys/rump/net/lib/libsockin/sockin.c
--- a/sys/rump/net/lib/libsockin/sockin.c Tue Apr 30 00:03:52 2013 +0000
+++ b/sys/rump/net/lib/libsockin/sockin.c Tue Apr 30 00:12:35 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sockin.c,v 1.29 2013/04/30 00:03:54 pooka Exp $ */
+/* $NetBSD: sockin.c,v 1.30 2013/04/30 00:12:35 pooka Exp $ */
/*
* Copyright (c) 2008, 2009 Antti Kantee. All Rights Reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.29 2013/04/30 00:03:54 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sockin.c,v 1.30 2013/04/30 00:12:35 pooka Exp $");
#include <sys/param.h>
#include <sys/condvar.h>
@@ -173,8 +173,7 @@
struct iovec io;
struct msghdr rmsg;
struct mbuf *m;
- ssize_t n;
- size_t plen;
+ size_t n, plen;
int error;
m = m_gethdr(M_WAIT, MT_DATA);
@@ -198,8 +197,8 @@
rmsg.msg_name = (struct sockaddr *)&from;
rmsg.msg_namelen = sizeof(from);
- n = rumpcomp_sockin_recvmsg(SO2S(so), &rmsg, 0, &error);
- if (n <= 0) {
+ error = rumpcomp_sockin_recvmsg(SO2S(so), &rmsg, 0, &n);
+ if (error) {
m_freem(m);
/* Treat a TCP socket a goner */
@@ -371,9 +370,9 @@
break;
}
- news = rumpcomp_sockin_socket(PF_INET, so->so_proto->pr_type,
- 0, &error);
- if (news == -1)
+ error = rumpcomp_sockin_socket(PF_INET, so->so_proto->pr_type,
+ 0, &news);
+ if (error)
break;
/* for UDP sockets, make sure we can send&recv max */
@@ -422,7 +421,7 @@
size_t iov_max, i;
struct iovec iov_buf[32], *iov;
struct mbuf *m2;
- size_t tot;
+ size_t tot, n;
int s;
bpf_mtap_af(&sockin_if, AF_UNSPEC, m);
@@ -457,7 +456,7 @@
mhdr.msg_namelen = saddr->sa_len;
}
- rumpcomp_sockin_sendmsg(s, &mhdr, 0, &error);
+ rumpcomp_sockin_sendmsg(s, &mhdr, 0, &n);
if (iov != iov_buf)
kmem_free(iov, sizeof(struct iovec) * iov_max);
Home |
Main Index |
Thread Index |
Old Index