From owner-svn-src-all@FreeBSD.ORG Mon Oct 20 17:41:09 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3CACB1065704; Mon, 20 Oct 2008 17:41:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AC818FC08; Mon, 20 Oct 2008 17:41:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id m9KHf9GJ076907; Mon, 20 Oct 2008 17:41:09 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id m9KHf9G3076906; Mon, 20 Oct 2008 17:41:09 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200810201741.m9KHf9G3076906@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Mon, 20 Oct 2008 17:41:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r184091 - head/lib/libutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Oct 2008 17:41:09 -0000 Author: des Date: Mon Oct 20 17:41:08 2008 New Revision: 184091 URL: http://svn.freebsd.org/changeset/base/184091 Log: There is no point in releasing a lock on a file which we've unlinked and are about to close, so don't. As a bonus, pidfile_remove(3) will now work with an fcntl(2)-based flopen(3). Modified: head/lib/libutil/pidfile.c Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Mon Oct 20 17:26:30 2008 (r184090) +++ head/lib/libutil/pidfile.c Mon Oct 20 17:41:08 2008 (r184091) @@ -231,10 +231,6 @@ _pidfile_remove(struct pidfh *pfh, int f if (unlink(pfh->pf_path) == -1) error = errno; - if (flock(pfh->pf_fd, LOCK_UN) == -1) { - if (error == 0) - error = errno; - } if (close(pfh->pf_fd) == -1) { if (error == 0) error = errno;