lockf is entirely useless and it was a mistake to change to it, go back

to using flock which actually works sensibly. Also always retry the lock
to fix a potential race, and add some extra logging.
This commit is contained in:
nicm
2014-07-21 10:52:48 +00:00
parent 2056a9ef9e
commit 8e4ae12b4d
2 changed files with 37 additions and 12 deletions

View File

@ -111,6 +111,7 @@ server_start(int lockfd, char *lockfile)
/* The first client is special and gets a socketpair; create it. */
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pair) != 0)
fatal("socketpair failed");
log_debug("starting server");
switch (fork()) {
case -1: