Skip to content
Snippets Groups Projects
Commit 9f3b0d60 authored by Howard Chu's avatar Howard Chu
Browse files

Fix EBCDIC conversion for syslog()

parent 253f70e0
No related branches found
No related tags found
No related merge requests found
......@@ -114,6 +114,12 @@ LDAP_BEGIN_DECL
# ifdef LDAP_SYSLOG
extern int ldap_syslog;
extern int ldap_syslog_level;
# ifdef HAVE_EBCDIC
# define syslog eb_syslog
extern void eb_syslog(int pri, const char *fmt, ...);
# endif
# endif /* LDAP_SYSLOG */
/* this doesn't below as part of ldap.h */
......
......@@ -302,3 +302,19 @@ void (lutil_debug)( int debug, int level, const char *fmt, ... )
fputs( buffer, stderr );
va_end( vl );
}
#if defined(HAVE_EBCDIC) && defined(LDAP_SYSLOG)
void eb_syslog( int pri, const char *fmt, ... )
{
char buffer[4096];
va_list vl;
va_start( vl, fmt );
vsnprintf( buffer, sizeof(buffer), fmt, vl );
buffer[sizeof(buffer)-1] = '\0';
__atoe(buffer);
syslog( pri, "%s", buffer );
va_end( vl );
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment