void ReportSlapdShutdownComplete( void );
void *getRegParam( char *svc, char *value );
-#define SERVICE_EXIT( e, n ) \
- if ( is_NT_Service ) \
-{ \
- SLAPDServiceStatus.dwWin32ExitCode = e; \
- SLAPDServiceStatus.dwServiceSpecificExitCode = n; \
-}
+#define SERVICE_EXIT( e, n ) do { \
+ if ( is_NT_Service ) { \
+ SLAPDServiceStatus.dwWin32ExitCode = (e); \
+ SLAPDServiceStatus.dwServiceSpecificExitCode = (n); \
+ } \
+} while ( 0 )
+
#else
#define SERVICE_EXIT( e, n )
#define MAIN_RETURN(x) return(x)
#endif
-#ifdef HAVE_NT_EVENT_MANAGER
+#ifdef HAVE_NT_EVENT_LOG
void LogSlapdStartedEvent( char *svc, int slap_debug, char *configfile, char *urls );
void LogSlapdStoppedEvent( char *svc );
#endif
#ifdef LOG_LOCAL4
"\t-l sysloguser\tSyslog User (default: LOCAL4)\n"
#endif
-#ifdef HAVE_WINSOCK
+#ifdef HAVE_NT_EVENT_LOG
"\t-n NTserviceName\tNT service name\n"
#endif
#ifdef LOG_LOCAL4
int syslogUser = DEFAULT_SYSLOG_USER;
#endif
-#ifdef HAVE_WINSOCK
+
+#ifdef HAVE_NT_EVENT_LOG
char *NTservice = SERVICE_NAME;
+#endif
+#ifdef HAVE_NT_SERVICE_MANAGER
char *configfile = ".\\slapd.conf";
#else
char *configfile = SLAPD_DEFAULT_CONFIGFILE;
#ifdef LDAP_CONNECTIONLESS
"c"
#endif
-#ifdef HAVE_WINSOCK
+#ifdef HAVE_NT_EVENT_LOG
"n:"
#endif
#ifdef HAVE_TLS
break;
#endif /* SETUID && GETUID */
-#ifdef HAVE_WINSOCK
+#ifdef HAVE_NT_EVENT_LOG
case 'n': /* NT service name */
NTservice = ch_strdup( optarg );
break;
#endif
#ifndef HAVE_WINSOCK
- lutil_detach( no_detach, 0 );
+ lutil_detach( no_detach, 0 );
#endif /* HAVE_WINSOCK */
#ifdef CSRIMALLOC
}
}
-#ifdef HAVE_NT_EVENT_MANAGER
+#ifdef HAVE_NT_EVENT_LOG
LogSlapdStartedEvent( NTservice, slap_debug, configfile, urls );
#endif
rc |= slap_destroy();
stop:
-#ifdef HAVE_NT_EVENT_MANAGER
+#ifdef HAVE_NT_EVENT_LOG
LogSlapdStoppedEvent( NTservice );
#endif