aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/gen/setproctitle.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gen/setproctitle.c')
-rw-r--r--lib/libc/gen/setproctitle.c33
1 files changed, 19 insertions, 14 deletions
diff --git a/lib/libc/gen/setproctitle.c b/lib/libc/gen/setproctitle.c
index 3f858952255c..715951a8c96d 100644
--- a/lib/libc/gen/setproctitle.c
+++ b/lib/libc/gen/setproctitle.c
@@ -1,23 +1,30 @@
-/*
- * Copyright (c) 1995 Peter Wemm <peter@freebsd.org>
- * All rights reserved.
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 1995 Peter Wemm
*
* Redistribution and use in source and binary forms, with or without
- * modification, is permitted provided that the following conditions
+ * modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
- * notice immediately at the beginning of the file, without modification,
- * this list of conditions, and the following disclaimer.
+ * notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. Absolutely no warranty of function or purpose is made by the author
- * Peter Wemm.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-
#include "namespace.h"
#include <sys/param.h>
#include <sys/elf_common.h>
@@ -62,7 +69,7 @@ setproctitle_internal(const char *fmt, va_list ap)
static struct ps_strings *ps_strings;
static char *buf = NULL;
static char *obuf = NULL;
- static char **oargv, *kbuf;
+ static char **oargv;
static int oargc = -1;
static char *nargv[2] = { NULL, NULL };
char **nargvp;
@@ -103,12 +110,10 @@ setproctitle_internal(const char *fmt, va_list ap)
nargvp = nargv;
nargc = 1;
- kbuf = buf;
} else if (*obuf != '\0') {
/* Idea from NetBSD - reset the title on fmt == NULL */
nargvp = oargv;
nargc = oargc;
- kbuf = obuf;
} else
/* Nothing to restore */
return (NULL);