The problem is that it returns -1 and sets errno to EDEADLK. That
shouldn't be possible as far as I know. EDEADLK should only be set if
cmd was F_SETLKW but I'm using F_SETLK. Obviously my daemon fails to
lock the file.
I would very grateful if someone could tell me how this could happen
and how to avoid it.