mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-15 03:01:09 +08:00
Fix EBCDIC conversion for syslog()
This commit is contained in:
parent
253f70e0c2
commit
9f3b0d60f9
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user