From 12b09c58e21501dbcff519cf7c82f13454a9ef7c Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 4 Feb 2004 23:00:05 +0000 Subject: [PATCH] Another EBCDIC syslog fix --- servers/slapd/main.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/servers/slapd/main.c b/servers/slapd/main.c index e5b8c18202..04e0c981f1 100644 --- a/servers/slapd/main.c +++ b/servers/slapd/main.c @@ -382,12 +382,25 @@ int main( int argc, char **argv ) } } -#ifdef LOG_LOCAL4 - openlog( serverName, OPENLOG_OPTIONS, syslogUser ); -#elif LOG_DEBUG - openlog( serverName, OPENLOG_OPTIONS ); + { + char *logName; +#ifdef HAVE_EBCDIC + logName = ch_strdup( serverName ); + __atoe( logName ); +#else + logName = serverName; #endif +#ifdef LOG_LOCAL4 + openlog( logName, OPENLOG_OPTIONS, syslogUser ); +#elif LOG_DEBUG + openlog( logName, OPENLOG_OPTIONS ); +#endif +#ifdef HAVE_EBCDIC + free( logName ); +#endif + } + #ifdef NEW_LOGGING LDAP_LOG( SLAPD, INFO, "%s", Versionstr, 0, 0 ); #else