privops: refactor initialisation/finalisation

Rename PRV_Initialise() to PRV_StartHelper() and add a new
initialisation function, which just sets the helper fd to -1. Move
the initialision/finalisation calls from the system drivers to main.c.
If privops is not included in the build, define empty macros for the
function names, so their calls don't have to be wrapped in #ifdefs.
This commit is contained in:
Miroslav Lichvar
2015-12-08 14:10:29 +01:00
parent aa9a4c697c
commit 610f234043
4 changed files with 19 additions and 6 deletions

3
main.c
View File

@@ -49,6 +49,7 @@
#include "refclock.h"
#include "clientlog.h"
#include "nameserv.h"
#include "privops.h"
#include "smooth.h"
#include "tempcomp.h"
#include "util.h"
@@ -111,6 +112,7 @@ MAI_CleanupAndExit(void)
NCR_Finalise();
NIO_Finalise();
CAM_Finalise();
PRV_Finalise();
KEY_Finalise();
RCL_Finalise();
SRC_Finalise();
@@ -484,6 +486,7 @@ int main
SRC_Initialise();
RCL_Initialise();
KEY_Initialise();
PRV_Initialise();
/* Open privileged ports before dropping root */
CAM_Initialise(address_family);