summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc_r/uthread/uthread_info.c12
-rw-r--r--lib/libc_r/uthread/uthread_info_openbsd.c13
-rw-r--r--lib/libpthread/uthread/uthread_info.c12
-rw-r--r--lib/libpthread/uthread/uthread_info_openbsd.c13
4 files changed, 32 insertions, 18 deletions
diff --git a/lib/libc_r/uthread/uthread_info.c b/lib/libc_r/uthread/uthread_info.c
index fc2f739962c..b528f9bd64e 100644
--- a/lib/libc_r/uthread/uthread_info.c
+++ b/lib/libc_r/uthread/uthread_info.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_info.c,v 1.10 2001/08/21 19:24:53 fgsch Exp $ */
+/* $OpenBSD: uthread_info.c,v 1.11 2002/10/21 23:10:29 marc Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -152,9 +152,13 @@ _thread_dump_info(void)
pthread->data.fd.fname,
pthread->data.fd.branch);
_thread_sys_write(fd, s, strlen(s));
- snprintf(s, sizeof(s), "owner %pr/%pw\n",
- _thread_fd_table[pthread->data.fd.fd]->r_owner,
- _thread_fd_table[pthread->data.fd.fd]->w_owner);
+ if (_thread_fd_table[pthread->data.fd.fd])
+ snprintf(s, sizeof(s), "owner %pr/%pw\n",
+ _thread_fd_table[pthread->data.fd.fd]->r_owner,
+ _thread_fd_table[pthread->data.fd.fd]->w_owner);
+ else
+ snprintf(s, sizeof(s), "owner [unknown]\n");
+
_thread_sys_write(fd, s, strlen(s));
break;
case PS_SIGWAIT:
diff --git a/lib/libc_r/uthread/uthread_info_openbsd.c b/lib/libc_r/uthread/uthread_info_openbsd.c
index a9f133550e9..be3423b9ba7 100644
--- a/lib/libc_r/uthread/uthread_info_openbsd.c
+++ b/lib/libc_r/uthread/uthread_info_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_info_openbsd.c,v 1.5 2001/12/11 00:19:47 fgsch Exp $ */
+/* $OpenBSD: uthread_info_openbsd.c,v 1.6 2002/10/21 23:10:30 marc Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
@@ -188,10 +188,13 @@ _thread_dump_entry(pthread, fd, verbose)
pthread->data.fd.branch);
_thread_sys_write(fd, s, strlen(s));
s[0] = 0;
- snprintf(s, sizeof(s), "%s owner %pr/%pw\n",
- info_lead,
- _thread_fd_table[pthread->data.fd.fd]->r_owner,
- _thread_fd_table[pthread->data.fd.fd]->w_owner);
+ if (_thread_fd_table[pthread->data.fd.fd])
+ snprintf(s, sizeof(s), "%s owner %pr/%pw\n",
+ info_lead,
+ _thread_fd_table[pthread->data.fd.fd]->r_owner,
+ _thread_fd_table[pthread->data.fd.fd]->w_owner);
+ else
+ snprintf(s, sizeof(s), "%s owner [unknown]\n", info_lead);
_thread_sys_write(fd, s, strlen(s));
break;
case PS_SIGWAIT:
diff --git a/lib/libpthread/uthread/uthread_info.c b/lib/libpthread/uthread/uthread_info.c
index fc2f739962c..b528f9bd64e 100644
--- a/lib/libpthread/uthread/uthread_info.c
+++ b/lib/libpthread/uthread/uthread_info.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_info.c,v 1.10 2001/08/21 19:24:53 fgsch Exp $ */
+/* $OpenBSD: uthread_info.c,v 1.11 2002/10/21 23:10:29 marc Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -152,9 +152,13 @@ _thread_dump_info(void)
pthread->data.fd.fname,
pthread->data.fd.branch);
_thread_sys_write(fd, s, strlen(s));
- snprintf(s, sizeof(s), "owner %pr/%pw\n",
- _thread_fd_table[pthread->data.fd.fd]->r_owner,
- _thread_fd_table[pthread->data.fd.fd]->w_owner);
+ if (_thread_fd_table[pthread->data.fd.fd])
+ snprintf(s, sizeof(s), "owner %pr/%pw\n",
+ _thread_fd_table[pthread->data.fd.fd]->r_owner,
+ _thread_fd_table[pthread->data.fd.fd]->w_owner);
+ else
+ snprintf(s, sizeof(s), "owner [unknown]\n");
+
_thread_sys_write(fd, s, strlen(s));
break;
case PS_SIGWAIT:
diff --git a/lib/libpthread/uthread/uthread_info_openbsd.c b/lib/libpthread/uthread/uthread_info_openbsd.c
index a9f133550e9..be3423b9ba7 100644
--- a/lib/libpthread/uthread/uthread_info_openbsd.c
+++ b/lib/libpthread/uthread/uthread_info_openbsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_info_openbsd.c,v 1.5 2001/12/11 00:19:47 fgsch Exp $ */
+/* $OpenBSD: uthread_info_openbsd.c,v 1.6 2002/10/21 23:10:30 marc Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
@@ -188,10 +188,13 @@ _thread_dump_entry(pthread, fd, verbose)
pthread->data.fd.branch);
_thread_sys_write(fd, s, strlen(s));
s[0] = 0;
- snprintf(s, sizeof(s), "%s owner %pr/%pw\n",
- info_lead,
- _thread_fd_table[pthread->data.fd.fd]->r_owner,
- _thread_fd_table[pthread->data.fd.fd]->w_owner);
+ if (_thread_fd_table[pthread->data.fd.fd])
+ snprintf(s, sizeof(s), "%s owner %pr/%pw\n",
+ info_lead,
+ _thread_fd_table[pthread->data.fd.fd]->r_owner,
+ _thread_fd_table[pthread->data.fd.fd]->w_owner);
+ else
+ snprintf(s, sizeof(s), "%s owner [unknown]\n", info_lead);
_thread_sys_write(fd, s, strlen(s));
break;
case PS_SIGWAIT: