Date: Mon, 20 Oct 2008 17:41:09 +0000 (UTC) From: Dag-Erling Smorgrav <des@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r184091 - head/lib/libutil Message-ID: <200810201741.m9KHf9G3076906@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200810201741.m9KHf9G3076906>