diff options
-rw-r--r-- | sys/compat/linux/linux_socket.c | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c index 01b007c..741a45b 100644 --- a/sys/compat/linux/linux_socket.c +++ b/sys/compat/linux/linux_socket.c @@ -448,7 +448,7 @@ linux_to_bsd_msg_flags(int flags) if (flags & LINUX_MSG_ERRQUEUE) ; #endif - return ret_flags; + return (ret_flags); } /* @@ -463,15 +463,12 @@ bsd_to_linux_sockaddr(struct sockaddr *arg) struct sockaddr sa; size_t sa_len = sizeof(struct sockaddr); int error; - + if ((error = copyin(arg, &sa, sa_len))) return (error); - + *(u_short *)&sa = sa.sa_family; - - error = copyout(&sa, arg, sa_len); - - return (error); + return (copyout(&sa, arg, sa_len)); } static int @@ -486,10 +483,7 @@ linux_to_bsd_sockaddr(struct sockaddr *arg, int len) sa.sa_family = *(sa_family_t *)&sa; sa.sa_len = len; - - error = copyout(&sa, arg, sa_len); - - return (error); + return (copyout(&sa, arg, sa_len)); } static int @@ -511,11 +505,7 @@ linux_sa_put(struct osockaddr *osa) return (EINVAL); sa.sa_family = bdom; - error = copyout(&sa, osa, sizeof(sa.sa_family)); - if (error) - return (error); - - return (0); + return (copyout(&sa, osa, sizeof(sa.sa_family))); } static int @@ -912,10 +902,7 @@ linux_getsockname(struct thread *td, struct linux_getsockname_args *args) bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.asa); if (error) return (error); - error = linux_sa_put(PTRIN(args->addr)); - if (error) - return (error); - return (0); + return (linux_sa_put(PTRIN(args->addr))); } int @@ -935,10 +922,7 @@ linux_getpeername(struct thread *td, struct linux_getpeername_args *args) bsd_to_linux_sockaddr((struct sockaddr *)bsd_args.asa); if (error) return (error); - error = linux_sa_put(PTRIN(args->addr)); - if (error) - return (error); - return (0); + return (linux_sa_put(PTRIN(args->addr))); } int @@ -1003,7 +987,7 @@ linux_send(struct thread *td, struct linux_send_args *args) bsd_args.flags = args->flags; bsd_args.to = NULL; bsd_args.tolen = 0; - return sys_sendto(td, &bsd_args); + return (sys_sendto(td, &bsd_args)); } struct linux_recv_args { @@ -1040,7 +1024,6 @@ linux_sendto(struct thread *td, struct linux_sendto_args *args) { struct msghdr msg; struct iovec aiov; - int error; if (linux_check_hdrincl(td, args->s) == 0) /* IP_HDRINCL set, tweak the packet before sending */ @@ -1054,9 +1037,8 @@ linux_sendto(struct thread *td, struct linux_sendto_args *args) msg.msg_flags = 0; aiov.iov_base = PTRIN(args->msg); aiov.iov_len = args->len; - error = linux_sendit(td, args->s, &msg, args->flags, NULL, - UIO_USERSPACE); - return (error); + return (linux_sendit(td, args->s, &msg, args->flags, NULL, + UIO_USERSPACE)); } int |