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).
This commit is contained in:
parent
75bd5e763f
commit
51e75198fa
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=184091
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user