bugfix: move mlock to after detach() so it works for child, not parent
authorMichael Tokarev <mjt@corpit.ru>
Mon, 18 May 2009 12:49:39 +0000 (16:49 +0400)
committerGuus Sliepen <guus@tinc-vpn.org>
Mon, 18 May 2009 13:03:56 +0000 (15:03 +0200)
mlock()/mlockall() are not persistent across fork(), and it's
done in parent process before daemon() which does fork().  So
basically, current --mlock does nothing useful.

Move mlock() to after detach() so it works for child process
instead of parent.

Also, check if the platform supports mlock right when processing
options (since else we'll have to die after startup, not at
startup, the error message will be in log only).


No differences found