Use flopen(3).

MFC after:	3 weeks
This commit is contained in:
Dag-Erling Smørgrav 2007-05-10 14:54:53 +00:00
parent 3dea593400
commit 3884dc6768
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169448

View File

@ -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);