]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/setproctitle.c
ITS#5129 fix alock_close with Quick mode
[openldap] / libraries / liblutil / setproctitle.c
index 0d7f04f881cd82be48dbaaf0c0d0cd70f871ddff..5f957c548953baba3b8f201ff3c04cd5c7bc8d7b 100644 (file)
@@ -1,21 +1,18 @@
-#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-2007 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 */
 
@@ -35,14 +44,7 @@ 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;
@@ -50,21 +52,10 @@ va_dcl
        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);