-#include "portable.h"
-
-#ifndef HAVE_SETPROCTITLE
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ac/string.h>
-
-#if defined( HAVE_STDARG_H ) && __STDC__
-#include <stdarg.h>
-#else
-#include <varargs.h>
-#endif
-
-#include <ac/setproctitle.h>
-
-/*
- * Copyright (c) 1990,1991 Regents of the University of Michigan.
+/* $OpenLDAP$ */
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2006 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
+ */
+/* Portions Copyright (c) 1990,1991 Regents of the University of Michigan.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* is provided ``as is'' without express or implied warranty.
*/
+#include "portable.h"
+
+#ifndef HAVE_SETPROCTITLE
+
+#include <stdio.h>
+
+#include <ac/stdlib.h>
+
+#include <ac/setproctitle.h>
+#include <ac/string.h>
+#include <ac/stdarg.h>
+
char **Argv; /* pointer to original (main's) argv */
int Argc; /* original argc */
*/
/* VARARGS */
-void setproctitle
-#if defined( HAVE_STDARG_H ) && __STDC__
- ( const char *fmt, ... )
-#else
- ( fmt, va_alist )
-const char *fmt;
-va_dcl
-#endif
+void setproctitle( const char *fmt, ... )
{
static char *endargv = (char *)0;
char *s;
char buf[ 1024 ];
va_list ap;
-#if defined( HAVE_STDARG_H ) && __STDC__
va_start(ap, fmt);
-#else
- va_start(ap);
-#endif
-#ifdef HAVE_VSNPRINTF
buf[sizeof(buf) - 1] = '\0';
vsnprintf( buf, sizeof(buf)-1, fmt, ap );
-#elif HAVE_VPRINTF
- vsprintf( buf, fmt, ap ); /* hope it's not too long */
-#else
- /* use doprnt() */
- chokeme = "choke me! I don't have a doprnt() manual handy";
-#endif
va_end(ap);