From 3884dc6768961113726a925196bd79921c167ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Thu, 10 May 2007 14:54:53 +0000 Subject: [PATCH] Use flopen(3). MFC after: 3 weeks --- lib/libutil/pidfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libutil/pidfile.c b/lib/libutil/pidfile.c index fc1516340cf7..e002d6534a6d 100644 --- a/lib/libutil/pidfile.c +++ b/lib/libutil/pidfile.c @@ -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);