summaryrefslogtreecommitdiff
path: root/usr/src/uts/common
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/common')
-rw-r--r--usr/src/uts/common/exec/elf/elf_notes.c4
-rw-r--r--usr/src/uts/common/fs/proc/prsubr.c6
-rw-r--r--usr/src/uts/common/fs/proc/prvnops.c16
3 files changed, 14 insertions, 12 deletions
diff --git a/usr/src/uts/common/exec/elf/elf_notes.c b/usr/src/uts/common/exec/elf/elf_notes.c
index 34456ccc1e..53a405b42d 100644
--- a/usr/src/uts/common/exec/elf/elf_notes.c
+++ b/usr/src/uts/common/exec/elf/elf_notes.c
@@ -526,8 +526,8 @@ write_elfnotes(proc_t *p, int sig, vnode_t *vp, offset_t offset,
if (error)
goto done;
- if (elfnote(vp, &offset, NT_LWPNAME, sizeof (name),
- (caddr_t)&name, rlimit, credp) != 0)
+ if ((error = elfnote(vp, &offset, NT_LWPNAME, sizeof (name),
+ (caddr_t)&name, rlimit, credp)) != 0)
goto done;
diff --git a/usr/src/uts/common/fs/proc/prsubr.c b/usr/src/uts/common/fs/proc/prsubr.c
index 3631b6df4b..2062970885 100644
--- a/usr/src/uts/common/fs/proc/prsubr.c
+++ b/usr/src/uts/common/fs/proc/prsubr.c
@@ -21,11 +21,11 @@
/*
* Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2018, Joyent, Inc.
+ * Copyright 2017, Joyent, Inc.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/* All Rights Reserved */
+/* All Rights Reserved */
#include <sys/types.h>
#include <sys/t_lock.h>
@@ -2702,7 +2702,7 @@ prgetlwpsinfo32(kthread_t *t, lwpsinfo32_t *psp)
#define PR_COPY_TIMESPEC(s, d, field) \
TIMESPEC_TO_TIMESPEC32(&d->field, &s->field);
-#define PR_COPY_BUF(s, d, field) \
+#define PR_COPY_BUF(s, d, field) \
bcopy(s->field, d->field, sizeof (d->field));
#define PR_IGNORE_FIELD(s, d, field)
diff --git a/usr/src/uts/common/fs/proc/prvnops.c b/usr/src/uts/common/fs/proc/prvnops.c
index 0492fc4e06..f03dc9a0b1 100644
--- a/usr/src/uts/common/fs/proc/prvnops.c
+++ b/usr/src/uts/common/fs/proc/prvnops.c
@@ -190,14 +190,14 @@ static prdirent_t lwpiddir[] = {
".." },
{ PR_LWPCTL, 3 * sizeof (prdirent_t), sizeof (prdirent_t),
"lwpctl" },
- { PR_LWPSTATUS, 4 * sizeof (prdirent_t), sizeof (prdirent_t),
+ { PR_LWPNAME, 4 * sizeof (prdirent_t), sizeof (prdirent_t),
+ "lwpname" },
+ { PR_LWPSTATUS, 5 * sizeof (prdirent_t), sizeof (prdirent_t),
"lwpstatus" },
- { PR_LWPSINFO, 5 * sizeof (prdirent_t), sizeof (prdirent_t),
+ { PR_LWPSINFO, 6 * sizeof (prdirent_t), sizeof (prdirent_t),
"lwpsinfo" },
- { PR_LWPUSAGE, 6 * sizeof (prdirent_t), sizeof (prdirent_t),
+ { PR_LWPUSAGE, 7 * sizeof (prdirent_t), sizeof (prdirent_t),
"lwpusage" },
- { PR_LWPNAME, 7 * sizeof (prdirent_t), sizeof (prdirent_t),
- "lwpname" },
{ PR_XREGS, 8 * sizeof (prdirent_t), sizeof (prdirent_t),
"xregs" },
{ PR_TMPLDIR, 9 * sizeof (prdirent_t), sizeof (prdirent_t),
@@ -1121,7 +1121,7 @@ pr_read_auxv(prnode_t *pnp, uio_t *uiop)
* we have two kinds of LDT structures to export -- one for compatibility
* mode, and one for long mode, sigh.
*
- * For now lets just have a ldt of size 0 for 64-bit processes.
+ * For now let's just have a ldt of size 0 for 64-bit processes.
*/
static int
pr_read_ldt(prnode_t *pnp, uio_t *uiop)
@@ -2911,8 +2911,10 @@ pr_write_lwpname(prnode_t *pnp, uio_t *uiop)
lwpname[THREAD_NAME_MAX - 1] = '\0';
- if ((error = prlock(pnp, ZNO)) != 0)
+ if ((error = prlock(pnp, ZNO)) != 0) {
+ kmem_free(lwpname, THREAD_NAME_MAX);
return (error);
+ }
t = pnp->pr_common->prc_thread;
if (t->t_name == NULL) {