Use flopen(3).
MFC after: 3 weeks
This commit is contained in:
parent
3dea593400
commit
3884dc6768
@ -112,8 +112,8 @@ pidfile_open(const char *path, mode_t mode, pid_t *pidptr)
|
||||
* PID file will be truncated again in pidfile_write(), so
|
||||
* pidfile_write() can be called multiple times.
|
||||
*/
|
||||
fd = open(pfh->pf_path,
|
||||
O_WRONLY | O_CREAT | O_EXLOCK | O_TRUNC | O_NONBLOCK, mode);
|
||||
fd = flopen(pfh->pf_path,
|
||||
O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, mode);
|
||||
if (fd == -1) {
|
||||
if (errno == EWOULDBLOCK && pidptr != NULL) {
|
||||
errno = pidfile_read(pfh->pf_path, pidptr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user