From owner-svn-src-stable-10@FreeBSD.ORG Sun Aug 17 07:24:24 2014 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15251A4E; Sun, 17 Aug 2014 07:24:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00CBE2402; Sun, 17 Aug 2014 07:24:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7H7ON2F045045; Sun, 17 Aug 2014 07:24:23 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7H7ONCM045044; Sun, 17 Aug 2014 07:24:23 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201408170724.s7H7ONCM045044@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Sun, 17 Aug 2014 07:24:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r270094 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Aug 2014 07:24:24 -0000 Author: mjg Date: Sun Aug 17 07:24:23 2014 New Revision: 270094 URL: http://svnweb.freebsd.org/changeset/base/270094 Log: MFC r269020: Cosmetic changes to unp_internalize Don't throw away the result of fget_unlocked. Move fdp increment to for loop to make it consistent with similar code elsewhere. Modified: stable/10/sys/kern/uipc_usrreq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/uipc_usrreq.c ============================================================================== --- stable/10/sys/kern/uipc_usrreq.c Sun Aug 17 07:22:40 2014 (r270093) +++ stable/10/sys/kern/uipc_usrreq.c Sun Aug 17 07:24:23 2014 (r270094) @@ -1853,7 +1853,7 @@ unp_internalize(struct mbuf **controlp, struct filedescent *fde, **fdep, *fdev; struct file *fp; struct timeval *tv; - int i, fd, *fdp; + int i, *fdp; void *data; socklen_t clen = control->m_len, datalen; int error, oldfds; @@ -1906,14 +1906,13 @@ unp_internalize(struct mbuf **controlp, */ fdp = data; FILEDESC_SLOCK(fdesc); - for (i = 0; i < oldfds; i++) { - fd = *fdp++; - if (fget_locked(fdesc, fd) == NULL) { + for (i = 0; i < oldfds; i++, fdp++) { + fp = fget_locked(fdesc, *fdp); + if (fp == NULL) { FILEDESC_SUNLOCK(fdesc); error = EBADF; goto out; } - fp = fdesc->fd_ofiles[fd].fde_file; if (!(fp->f_ops->fo_flags & DFLAG_PASSABLE)) { FILEDESC_SUNLOCK(fdesc); error = EOPNOTSUPP;