diff options
author | des <des@FreeBSD.org> | 2008-10-20 17:41:08 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2008-10-20 17:41:08 +0000 |
commit | fef0e9dfaf9a4f8f338a65205bfa66d949534c2b (patch) | |
tree | 1aff43d6465396a1817ad80dab1e2c6917f33972 /lib | |
parent | 87e3b3e46d09d6928ebb3b0cfb84ab6f887adbb8 (diff) | |
download | FreeBSD-src-fef0e9dfaf9a4f8f338a65205bfa66d949534c2b.zip FreeBSD-src-fef0e9dfaf9a4f8f338a65205bfa66d949534c2b.tar.gz |
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).
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libutil/pidfile.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/libutil/pidfile.c b/lib/libutil/pidfile.c index ecf0fac..6b99936 100644 --- a/lib/libutil/pidfile.c +++ b/lib/libutil/pidfile.c @@ -231,10 +231,6 @@ _pidfile_remove(struct pidfh *pfh, int freeit) 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; |