From 2a12f85ad140e332791b4bad1208a734c3f26bf3 Mon Sep 17 00:00:00 2001 From: Jeremy Jones Date: Wed, 21 Aug 2013 15:45:46 -0800 Subject: 3946 ::gcore Reviewed by: Adam Leventhal Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi --- usr/src/lib/libproc/common/Plwpregs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'usr/src/lib/libproc/common/Plwpregs.c') diff --git a/usr/src/lib/libproc/common/Plwpregs.c b/usr/src/lib/libproc/common/Plwpregs.c index 7549bc142d..c2b150000f 100644 --- a/usr/src/lib/libproc/common/Plwpregs.c +++ b/usr/src/lib/libproc/common/Plwpregs.c @@ -25,6 +25,7 @@ /* * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -50,10 +51,11 @@ static lwp_info_t * getlwpcore(struct ps_prochandle *P, lwpid_t lwpid) { - lwp_info_t *lwp = list_next(&P->core->core_lwp_head); + core_info_t *core = P->data; + lwp_info_t *lwp = list_next(&core->core_lwp_head); uint_t i; - for (i = 0; i < P->core->core_nlwp; i++, lwp = list_next(lwp)) { + for (i = 0; i < core->core_nlwp; i++, lwp = list_next(lwp)) { if (lwp->lwp_id == lwpid) return (lwp); } @@ -118,7 +120,7 @@ getlwpstatus(struct ps_prochandle *P, lwpid_t lwpid, lwpstatus_t *lps) * If this is a core file, we need to iterate through our list of * cached lwp information and then copy out the status. */ - if (P->core != NULL && (lwp = getlwpcore(P, lwpid)) != NULL) { + if (P->data != NULL && (lwp = getlwpcore(P, lwpid)) != NULL) { (void) memcpy(lps, &lwp->lwp_status, sizeof (lwpstatus_t)); return (0); } -- cgit v1.2.3