]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/shell-backends/shellutil.c
Implemented the open, init functions correctly
[openldap] / servers / slapd / shell-backends / shellutil.c
index 82eea1665b8d879664c61c833e4e9f89d088b5f1..59d43cb7073fe07c7d17ff9a17c421d4bd3780d9 100644 (file)
 */
 
 
-#include <sys/types.h>
+#include "portable.h"
+
 #include <stdio.h>
-#include <string.h>
+
 #include <stdlib.h>
+#include <ac/stdarg.h>
+
 #include <pwd.h>
-#include <varargs.h>
+
+#include <ac/ctype.h>
+#include <ac/string.h>
+
 #include <lber.h>
 #include <ldap.h>
 #include "shellutil.h"
@@ -314,19 +320,30 @@ ecalloc( unsigned nelem, unsigned elsize )
 
 /* VARARGS */
 void
-debug_printf( va_alist /* char *fmt, args... */ )
+debug_printf
+#ifdef STDC_HEADERS
+       ( char *fmt, ... )
+#else
+       ( va_alist )
     va_dcl
+#endif
 {
-    char       *fmt;
     va_list    ap;
-
-    if ( debugflg ) {
-       va_start( ap );
-       fmt = va_arg( ap, char * );
-       fprintf( stderr, "%s: ", progname );
-       vfprintf( stderr, fmt, ap );
-       va_end( ap );
-    }
+#ifndef STDC_HEADERS
+    char       *fmt;
+#endif
+
+       if ( debugflg ) {
+#ifdef STDC_HEADERS
+               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 );
+       }
 }