From owner-svn-src-head@FreeBSD.ORG Fri Sep 12 21:20:37 2014 Return-Path: Delivered-To: svn-src-head@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 41D7DFE0; Fri, 12 Sep 2014 21:20:37 +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 2D8EEAD9; Fri, 12 Sep 2014 21:20:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8CLKbiA066807; Fri, 12 Sep 2014 21:20:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8CLKbeU066806; Fri, 12 Sep 2014 21:20:37 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201409122120.s8CLKbeU066806@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 12 Sep 2014 21:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r271488 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Sep 2014 21:20:37 -0000 Author: jhb Date: Fri Sep 12 21:20:36 2014 New Revision: 271488 URL: http://svnweb.freebsd.org/changeset/base/271488 Log: Tweak pipe_truncate() to more closely match pipe_chown() and pipe_chmod() by checking PIPE_NAMED and using invfo_truncate() for unnamed pipes. Modified: head/sys/kern/sys_pipe.c Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Fri Sep 12 21:01:39 2014 (r271487) +++ head/sys/kern/sys_pipe.c Fri Sep 12 21:20:36 2014 (r271488) @@ -1324,11 +1324,15 @@ pipe_truncate(fp, length, active_cred, t struct ucred *active_cred; struct thread *td; { + struct pipe *cpipe; + int error; - /* For named pipes call the vnode operation. */ - if (fp->f_vnode != NULL) - return (vnops.fo_truncate(fp, length, active_cred, td)); - return (EINVAL); + cpipe = fp->f_data; + if (cpipe->pipe_state & PIPE_NAMED) + error = vnops.fo_truncate(fp, length, active_cred, td); + else + error = invfo_truncate(fp, length, active_cred, td); + return (error); } /*