Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Remove trailing whitespaces, wrap long lines, minor...
details: https://anonhg.NetBSD.org/src/rev/0057c8a2e412
branches: trunk
changeset: 329278:0057c8a2e412
user: rmind <rmind%NetBSD.org@localhost>
date: Sat May 17 21:45:02 2014 +0000
description:
Remove trailing whitespaces, wrap long lines, minor KNF; no functional changes.
diffstat:
sys/kern/uipc_syscalls.c | 135 ++++++++++++++++++++++++----------------------
1 files changed, 69 insertions(+), 66 deletions(-)
diffs (truncated from 419 to 300 lines):
diff -r f24c15a569d1 -r 0057c8a2e412 sys/kern/uipc_syscalls.c
--- a/sys/kern/uipc_syscalls.c Sat May 17 21:26:20 2014 +0000
+++ b/sys/kern/uipc_syscalls.c Sat May 17 21:45:02 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_syscalls.c,v 1.166 2014/04/07 15:35:23 seanb Exp $ */
+/* $NetBSD: uipc_syscalls.c,v 1.167 2014/05/17 21:45:02 rmind Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.166 2014/04/07 15:35:23 seanb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.167 2014/05/17 21:45:02 rmind Exp $");
#include "opt_pipe.h"
@@ -92,23 +92,24 @@
extern const struct fileops socketops;
int
-sys___socket30(struct lwp *l, const struct sys___socket30_args *uap, register_t *retval)
+sys___socket30(struct lwp *l, const struct sys___socket30_args *uap,
+ register_t *retval)
{
/* {
syscallarg(int) domain;
syscallarg(int) type;
syscallarg(int) protocol;
} */
- int fd, error;
+ int fd, error;
error = fsocreate(SCARG(uap, domain), NULL, SCARG(uap, type),
- SCARG(uap, protocol), l, &fd);
- if (error == 0)
+ SCARG(uap, protocol), l, &fd);
+ if (error == 0) {
*retval = fd;
+ }
return error;
}
-/* ARGSUSED */
int
sys_bind(struct lwp *l, const struct sys_bind_args *uap, register_t *retval)
{
@@ -145,7 +146,6 @@
return error;
}
-/* ARGSUSED */
int
sys_listen(struct lwp *l, const struct sys_listen_args *uap, register_t *retval)
{
@@ -164,8 +164,8 @@
}
int
-do_sys_accept(struct lwp *l, int sock, struct mbuf **name, register_t *new_sock,
- const sigset_t *mask, int flags, int clrflags)
+do_sys_accept(struct lwp *l, int sock, struct mbuf **name,
+ register_t *new_sock, const sigset_t *mask, int flags, int clrflags)
{
file_t *fp, *fp2;
struct mbuf *nam;
@@ -174,14 +174,14 @@
short wakeup_state = 0;
if ((fp = fd_getfile(sock)) == NULL)
- return (EBADF);
+ return EBADF;
if (fp->f_type != DTYPE_SOCKET) {
fd_putfile(sock);
- return (ENOTSOCK);
+ return ENOTSOCK;
}
if ((error = fd_allocfile(&fp2, &fd)) != 0) {
fd_putfile(sock);
- return (error);
+ return error;
}
nam = m_get(M_WAIT, MT_SONAME);
*new_sock = fd;
@@ -257,15 +257,15 @@
fd_putfile(sock);
if (__predict_false(mask))
sigsuspendteardown(l);
- return (error);
+ return error;
bad:
- sounlock(so);
- m_freem(nam);
+ sounlock(so);
+ m_freem(nam);
fd_putfile(sock);
- fd_abort(curproc, fp2, fd);
+ fd_abort(curproc, fp2, fd);
if (__predict_false(mask))
sigsuspendteardown(l);
- return (error);
+ return error;
}
int
@@ -333,9 +333,9 @@
return error;
}
-/* ARGSUSED */
int
-sys_connect(struct lwp *l, const struct sys_connect_args *uap, register_t *retval)
+sys_connect(struct lwp *l, const struct sys_connect_args *uap,
+ register_t *retval)
{
/* {
syscallarg(int) s;
@@ -401,21 +401,22 @@
if (error == ERESTART)
error = EINTR;
out:
- sounlock(so);
- fd_putfile(fd);
+ sounlock(so);
+ fd_putfile(fd);
m_freem(nam);
- return (error);
+ return error;
}
static int
makesocket(struct lwp *l, file_t **fp, int *fd, int flags, int type,
int domain, int proto, struct socket *soo)
{
+ struct socket *so;
int error;
- struct socket *so;
- if ((error = socreate(domain, &so, type, proto, l, soo)) != 0)
+ if ((error = socreate(domain, &so, type, proto, l, soo)) != 0) {
return error;
+ }
if ((error = fd_allocfile(fp, fd)) != 0) {
soclose(so);
@@ -446,14 +447,12 @@
file_t *fp1, *fp2;
struct socket *so1, *so2;
int fd, error, sv[2];
- proc_t *p;
+ proc_t *p = curproc;
int flags = SCARG(uap, type) & SOCK_FLAGS_MASK;
int type = SCARG(uap, type) & ~SOCK_FLAGS_MASK;
int domain = SCARG(uap, domain);
int proto = SCARG(uap, protocol);
- p = curproc;
-
error = makesocket(l, &fp1, &fd, flags, type, domain, proto, NULL);
if (error)
return error;
@@ -492,7 +491,8 @@
}
int
-sys_sendto(struct lwp *l, const struct sys_sendto_args *uap, register_t *retval)
+sys_sendto(struct lwp *l, const struct sys_sendto_args *uap,
+ register_t *retval)
{
/* {
syscallarg(int) s;
@@ -517,7 +517,8 @@
}
int
-sys_sendmsg(struct lwp *l, const struct sys_sendmsg_args *uap, register_t *retval)
+sys_sendmsg(struct lwp *l, const struct sys_sendmsg_args *uap,
+ register_t *retval)
{
/* {
syscallarg(int) s;
@@ -645,14 +646,14 @@
kmem_free(ktriov, iovsz);
}
- if (iov != aiov)
- kmem_free(iov, iovsz);
+ if (iov != aiov)
+ kmem_free(iov, iovsz);
if (to)
m_freem(to);
if (control)
m_freem(control);
- return (error);
+ return error;
}
int
@@ -671,7 +672,8 @@
}
int
-sys_recvfrom(struct lwp *l, const struct sys_recvfrom_args *uap, register_t *retval)
+sys_recvfrom(struct lwp *l, const struct sys_recvfrom_args *uap,
+ register_t *retval)
{
/* {
syscallarg(int) s;
@@ -706,7 +708,8 @@
}
int
-sys_recvmsg(struct lwp *l, const struct sys_recvmsg_args *uap, register_t *retval)
+sys_recvmsg(struct lwp *l, const struct sys_recvmsg_args *uap,
+ register_t *retval)
{
/* {
syscallarg(int) s;
@@ -719,7 +722,7 @@
error = copyin(SCARG(uap, msg), &msg, sizeof(msg));
if (error)
- return (error);
+ return error;
msg.msg_flags = (SCARG(uap, flags) & MSG_USERFLAGS) | MSG_IOVUSRSPACE;
@@ -741,7 +744,7 @@
error = copyout(&msg, SCARG(uap, msg), sizeof(msg));
}
- return (error);
+ return error;
}
int
@@ -989,7 +992,7 @@
out:
if (iov != aiov)
kmem_free(iov, iovsz);
- return (error);
+ return error;
}
@@ -1116,9 +1119,9 @@
return error;
}
-/* ARGSUSED */
int
-sys_shutdown(struct lwp *l, const struct sys_shutdown_args *uap, register_t *retval)
+sys_shutdown(struct lwp *l, const struct sys_shutdown_args *uap,
+ register_t *retval)
{
/* {
syscallarg(int) s;
@@ -1128,17 +1131,17 @@
int error;
if ((error = fd_getsock(SCARG(uap, s), &so)) != 0)
- return (error);
+ return error;
solock(so);
error = soshutdown(so, SCARG(uap, how));
sounlock(so);
fd_putfile(SCARG(uap, s));
- return (error);
+ return error;
}
-/* ARGSUSED */
int
-sys_setsockopt(struct lwp *l, const struct sys_setsockopt_args *uap, register_t *retval)
+sys_setsockopt(struct lwp *l, const struct sys_setsockopt_args *uap,
+ register_t *retval)
{
/* {
syscallarg(int) s;
@@ -1155,10 +1158,10 @@
len = SCARG(uap, valsize);
if (len > 0 && SCARG(uap, val) == NULL)
- return (EINVAL);
+ return EINVAL;
if (len > MCLBYTES)
- return (EINVAL);
+ return EINVAL;
if ((error = fd_getsock1(SCARG(uap, s), &so, &fp)) != 0)
return (error);
@@ -1179,13 +1182,13 @@
out:
sockopt_destroy(&sopt);
- fd_putfile(SCARG(uap, s));
- return (error);
Home |
Main Index |
Thread Index |
Old Index