Commit f5f130e0 authored by Moritz Grimm's avatar Moritz Grimm
Browse files

Do not block when trying to lock a PID file; fail immediately

parent 8cc45a3a
......@@ -168,7 +168,7 @@ util_write_pid_file(const char *path)
pid = getpid();
if (0 >= fprintf(pidfile_file, "%ld\n", (long)pid) ||
0 > fflush(pidfile_file) ||
0 > flock(fileno(pidfile_file), LOCK_EX))
0 > flock(fileno(pidfile_file), LOCK_EX | LOCK_NB))
goto error;
if (0 == pidfile_numlocks) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment