X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fshell-backends%2Fshellutil.c;h=d05ec738959ea8f05eb941cf809f99f9fbb96e28;hb=403f4479bc9f9a864122d4aeecf7284408918302;hp=82529aef45ce62e22998b3da25a223dfc74885e0;hpb=6f8c9a78903b4a03e94b2305eae9c0245cd049c1;p=openldap diff --git a/servers/slapd/shell-backends/shellutil.c b/servers/slapd/shell-backends/shellutil.c index 82529aef45..d05ec73895 100644 --- a/servers/slapd/shell-backends/shellutil.c +++ b/servers/slapd/shell-backends/shellutil.c @@ -1,3 +1,4 @@ +/* $OpenLDAP$ */ /* shellutil.c - common routines useful when building shell-based backends for the standalone ldap server @@ -18,7 +19,7 @@ #include -#include +#include #include #include @@ -275,7 +276,7 @@ estrdup( char *s ) if (( p = strdup( s )) == NULL ) { debug_printf( "strdup failed\n" ); - exit( 1 ); + exit( EXIT_FAILURE ); } return( p ); @@ -295,7 +296,7 @@ erealloc( void *s, unsigned size ) if ( p == NULL ) { debug_printf( "realloc( p, %d ) failed\n", size ); - exit( 1 ); + exit( EXIT_FAILURE ); } return( p ); @@ -309,7 +310,7 @@ ecalloc( unsigned nelem, unsigned elsize ) if (( p = calloc( nelem, elsize )) == NULL ) { debug_printf( "calloc( %d, %d ) failed\n", nelem, elsize ); - exit( 1 ); + exit( EXIT_FAILURE ); } return( p ); @@ -320,26 +321,12 @@ ecalloc( unsigned nelem, unsigned elsize ) /* VARARGS */ void -debug_printf -#if HAVE_STDARG - ( char *fmt, ... ) -#else - ( va_alist ) - va_dcl -#endif +debug_printf( const char *fmt, ... ) { va_list ap; -#if !HAVE_STDARG - char *fmt; -#endif if ( debugflg ) { -#if HAVE_STDARG va_start( ap, fmt ); -#else - va_start( ap ); - fmt = va_arg( ap, char * ); -#endif fprintf( stderr, "%s: ", progname ); vfprintf( stderr, fmt, ap ); va_end( ap );