/** Handles a SIG_HUP signal from the system. * * @internal */ static void HandleSigHup(void) { /* Reinitialize */ SLPDLog("****************************************\n"); SLPDLogTime(); SLPDLog("SLPD daemon reset by SIGHUP\n"); SLPDLog("****************************************\n\n"); /* unregister with all DAs */ SLPDKnownDADeinit(); /* re-read properties */ SLPDPropertyReinit(); #ifdef ENABLE_SLPv2_SECURITY /* Re-initialize SPI stuff*/ SLPDSpiInit(G_SlpdCommandLine.spifile); #endif /* Re-read the static registration file (slp.reg)*/ SLPDDatabaseReInit(G_SlpdCommandLine.regfile); /* Rebuild Known DA database */ SLPDKnownDAInit(); SLPDLog("****************************************\n"); SLPDLogTime(); SLPDLog("SLPD daemon reset finished\n"); SLPDLog("****************************************\n\n"); }
/*------------------------------------------------------------------------*/ void HandleSigHup() /*------------------------------------------------------------------------*/ { /* Reinitialize */ SLPLog("****************************************\n"); SLPLogTime(); SLPLog("SLPD daemon reset by SIGHUP\n"); SLPLog("****************************************\n\n"); /* unregister with all DAs */ SLPDKnownDADeinit(); /* re-read properties */ SLPDPropertyInit(G_SlpdCommandLine.cfgfile); /* Re-read the static registration file (slp.reg)*/ SLPDDatabaseReInit(G_SlpdCommandLine.regfile); /* Rebuild Known DA database */ SLPDKnownDAInit(); SLPLog("****************************************\n"); SLPLogTime(); SLPLog("SLPD daemon reset finished\n"); SLPLog("****************************************\n\n"); }
/*=========================================================================*/ int SLPDDatabaseInit(const char* regfile) /* Initialize the database with registrations from a regfile. */ /* */ /* regfile (IN) the regfile to register. Pass in NULL for no regfile */ /* */ /* Returns - zero on success or non-zero on error. */ /*=========================================================================*/ { /* Set initial values */ memset(&G_SlpdDatabase,0,sizeof(G_SlpdDatabase)); G_SlpdDatabase.urlcount = SLPDDATABASE_INITIAL_URLCOUNT; G_SlpdDatabase.srvtypelistlen = SLPDDATABASE_INITIAL_SRVTYPELISTLEN; SLPDatabaseInit(&G_SlpdDatabase.database); /* Call the reinit function */ return SLPDDatabaseReInit(regfile); }