]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/setproctitle.c
ITS#5129 fix alock_close with Quick mode
[openldap] / libraries / liblutil / setproctitle.c
index 6578a8089504925f1c8da910ae11ed5342de9635..5f957c548953baba3b8f201ff3c04cd5c7bc8d7b 100644 (file)
@@ -1,3 +1,28 @@
+/* $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
+ * provided that this notice is preserved and that due credit is given
+ * to the University of Michigan at Ann Arbor. The name of the University
+ * may not be used to endorse or promote products derived from this
+ * software without specific prior written permission. This software
+ * is provided ``as is'' without express or implied warranty.
+ */
+
 #include "portable.h"
 
 #ifndef HAVE_SETPROCTITLE
 #include <ac/string.h>
 #include <ac/stdarg.h>
 
-/*
- * Copyright (c) 1990,1991 Regents of the University of Michigan.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that this notice is preserved and that due credit is given
- * to the University of Michigan at Ann Arbor. The name of the University
- * may not be used to endorse or promote products derived from this
- * software without specific prior written permission. This software
- * is provided ``as is'' without express or implied warranty.
- */
-
 char   **Argv;         /* pointer to original (main's) argv */
 int    Argc;           /* original argc */
 
@@ -31,13 +44,7 @@ int  Argc;           /* original argc */
  */
 
 /* VARARGS */
-void setproctitle
-#if defined( HAVE_STDARG )
-       ( const char *fmt, ... )
-#else
-       ( va_alist )
-va_dcl
-#endif
+void setproctitle( const char *fmt, ... )
 {
        static char *endargv = (char *)0;
        char    *s;
@@ -45,24 +52,10 @@ va_dcl
        char    buf[ 1024 ];
        va_list ap;
 
-#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
        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);