From: kn Date: Sat, 15 Apr 2023 13:18:28 +0000 (+0000) Subject: return directly to drop needless error variable; OK mvs X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=3a5067a8ff10e0c8b434a8e66032cfcd0543a926;p=openbsd return directly to drop needless error variable; OK mvs --- diff --git a/sys/kern/sys_socket.c b/sys/kern/sys_socket.c index 13cf7c41b09..8a0c8ed0e00 100644 --- a/sys/kern/sys_socket.c +++ b/sys/kern/sys_socket.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sys_socket.c,v 1.60 2023/01/22 12:05:44 mvs Exp $ */ +/* $OpenBSD: sys_socket.c,v 1.61 2023/04/15 13:18:28 kn Exp $ */ /* $NetBSD: sys_socket.c,v 1.13 1995/08/12 23:59:09 mycroft Exp $ */ /* @@ -83,7 +83,6 @@ int soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct proc *p) { struct socket *so = (struct socket *)fp->f_data; - int error = 0; switch (cmd) { @@ -109,8 +108,7 @@ soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct proc *p) case FIOSETOWN: case SIOCSPGRP: case TIOCSPGRP: - error = sigio_setown(&so->so_sigio, cmd, data); - break; + return sigio_setown(&so->so_sigio, cmd, data); case FIOGETOWN: case SIOCGPGRP: @@ -128,17 +126,14 @@ soo_ioctl(struct file *fp, u_long cmd, caddr_t data, struct proc *p) * interface and routing ioctls should have a * different entry since a socket's unnecessary */ - if (IOCGROUP(cmd) == 'i') { - error = ifioctl(so, cmd, data, p); - return (error); - } + if (IOCGROUP(cmd) == 'i') + return ifioctl(so, cmd, data, p); if (IOCGROUP(cmd) == 'r') return (EOPNOTSUPP); - error = pru_control(so, cmd, data, NULL); - break; + return pru_control(so, cmd, data, NULL); } - return (error); + return (0); } int