From: Howard Chu Date: Fri, 12 May 2000 21:26:30 +0000 (+0000) Subject: Fix previous change to getRegParam, SERVICE_NAME is only known in slapd. X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2992 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9a79d03e136e86369733d76596152a3b744b66a8;p=openldap Fix previous change to getRegParam, SERVICE_NAME is only known in slapd. --- diff --git a/libraries/liblutil/ntservice.c b/libraries/liblutil/ntservice.c index d9be5df496..ce036b4944 100644 --- a/libraries/liblutil/ntservice.c +++ b/libraries/liblutil/ntservice.c @@ -293,7 +293,7 @@ void *getRegParam( char *svc, char *value ) static char vValue[1024]; DWORD valLen = sizeof( vValue ); - if ( svc && strcmp(svc, SERVICE_NAME) ) + if ( svc != NULL ) sprintf ( path, "SOFTWARE\\%s", svc ); else strcpy (path, "SOFTWARE\\OpenLDAP\\Parameters" ); diff --git a/servers/slapd/main.c b/servers/slapd/main.c index 84e0d28deb..3dd6a9a211 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -172,20 +172,23 @@ int main( int argc, char **argv ) int *i; char *newConfigFile; char *newUrls; + char *regService = NULL; if ( is_NT_Service ) { NTservice = argv[0]; CommenceStartupProcessing( NTservice, slap_sig_shutdown ); + if ( strcmp(NTservice, SERVICE_NAME) ) + regService = NTservice; } - i = (int*)getRegParam( NTservice, "DebugLevel" ); + i = (int*)getRegParam( regService, "DebugLevel" ); if ( i != NULL ) { slap_debug = *i; Debug( LDAP_DEBUG_ANY, "new debug level from registry is: %d\n", slap_debug, 0, 0 ); } - newUrls = (char *) getRegParam(NTservice, "Urls"); + newUrls = (char *) getRegParam(regService, "Urls"); if (newUrls) { if (urls) @@ -196,7 +199,7 @@ int main( int argc, char **argv ) urls, 0, 0); } - newConfigFile = (char*)getRegParam( NTservice, "ConfigFile" ); + newConfigFile = (char*)getRegParam( regService, "ConfigFile" ); if ( newConfigFile != NULL ) { configfile = newConfigFile;