Use funlinkat in pidfile to ensure we are removing the right file.
This commit is contained in:
parent
a489026566
commit
8a9e93bb21
@ -293,8 +293,11 @@ _pidfile_remove(struct pidfh *pfh, int freeit)
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlinkat(pfh->pf_dirfd, pfh->pf_filename, 0) == -1)
|
if (funlinkat(pfh->pf_dirfd, pfh->pf_filename, pfh->pf_fd, 0) == -1) {
|
||||||
|
if (errno == EDEADLK)
|
||||||
|
return (-1);
|
||||||
error = errno;
|
error = errno;
|
||||||
|
}
|
||||||
if (close(pfh->pf_fd) == -1 && error == 0)
|
if (close(pfh->pf_fd) == -1 && error == 0)
|
||||||
error = errno;
|
error = errno;
|
||||||
if (close(pfh->pf_dirfd) == -1 && error == 0)
|
if (close(pfh->pf_dirfd) == -1 && error == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user