]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/setproctitle.c
If we are using lutil_lock functions then define NEED_SIMPLE_LOCKING or
[openldap] / libraries / liblutil / setproctitle.c
index b2a590b6121f9d9b83ae75c188ec9ac7bc619912..4c13eb95d16dc5fc49036f8ad02b91719c49f5e0 100644 (file)
@@ -2,15 +2,12 @@
 
 #ifndef HAVE_SETPROCTITLE
 
+#include <stdio.h>
 #include <stdlib.h>
 
-#if defined( HAVE_STDARG_H ) && __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
 #include <ac/setproctitle.h>
+#include <ac/string.h>
+#include <ac/stdarg.h>
 
 /*
  * Copyright (c) 1990,1991 Regents of the University of Michigan.
@@ -34,11 +31,10 @@ int Argc;           /* original argc */
 
 /* VARARGS */
 void setproctitle
-#if defined( HAVE_STDARG_H ) && __STDC__
+#if defined( HAVE_STDARG )
        ( const char *fmt, ... )
 #else
-       ( fmt, va_alist )
-const char *fmt;
+       ( va_alist )
 va_dcl
 #endif
 {
@@ -48,10 +44,13 @@ va_dcl
        char    buf[ 1024 ];
        va_list ap;
 
-#if defined( HAVE_STDARG_H ) && __STDC__
+#if defined( HAVE_STDARG )
        va_start(ap, fmt);
 #else
+       const char *fmt;
+
        va_start(ap);
+       fmt = va_arg(ap, const char *);
 #endif
 
 #ifdef HAVE_VSNPRINTF