diff options
author | davidxu <davidxu@FreeBSD.org> | 2003-07-07 12:12:33 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2003-07-07 12:12:33 +0000 |
commit | ac66c4d2c8aa1e8b3104a507f9ee3a028d2214dc (patch) | |
tree | 7fae6e439c4264df540eee71d4764fb8a56e78df /lib/libpthread | |
parent | d0451a39d871a9ae7b43da45ba0a873b24fdb118 (diff) | |
download | FreeBSD-src-ac66c4d2c8aa1e8b3104a507f9ee3a028d2214dc.zip FreeBSD-src-ac66c4d2c8aa1e8b3104a507f9ee3a028d2214dc.tar.gz |
Correctly print signal mask, the bug was introduced by cut and paste
in last commit.
Diffstat (limited to 'lib/libpthread')
-rw-r--r-- | lib/libpthread/thread/thr_info.c | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/lib/libpthread/thread/thr_info.c b/lib/libpthread/thread/thr_info.c index edfe233..27ef3d1 100644 --- a/lib/libpthread/thread/thr_info.c +++ b/lib/libpthread/thread/thr_info.c @@ -167,19 +167,20 @@ dump_thread(int fd, pthread_t pthread, int long_version) strcpy(s, "This is the initial thread\n"); __sys_write(fd, s, strlen(s)); } - snprintf(s, sizeof(s), "sigmask (hi) "); - __sys_write(fd, s, strlen(s)); - for (i = _SIG_WORDS - 1; i >= 0; i--) { - snprintf(s, sizeof(s), "%08x ", - pthread->oldsigmask.__bits[i]); - __sys_write(fd, s, strlen(s)); - } - snprintf(s, sizeof(s), "(lo)\n"); - __sys_write(fd, s, strlen(s)); - + /* Process according to thread state: */ switch (pthread->state) { case PS_SIGWAIT: + snprintf(s, sizeof(s), "sigmask (hi) "); + __sys_write(fd, s, strlen(s)); + for (i = _SIG_WORDS - 1; i >= 0; i--) { + snprintf(s, sizeof(s), "%08x ", + pthread->sigmask.__bits[i]); + __sys_write(fd, s, strlen(s)); + } + snprintf(s, sizeof(s), "(lo)\n"); + __sys_write(fd, s, strlen(s)); + snprintf(s, sizeof(s), "waitset (hi) "); __sys_write(fd, s, strlen(s)); for (i = _SIG_WORDS - 1; i >= 0; i--) { @@ -195,7 +196,15 @@ dump_thread(int fd, pthread_t pthread, int long_version) * coded to dump information: */ default: - /* Nothing to do here. */ + snprintf(s, sizeof(s), "sigmask (hi) "); + __sys_write(fd, s, strlen(s)); + for (i = _SIG_WORDS - 1; i >= 0; i--) { + snprintf(s, sizeof(s), "%08x ", + pthread->sigmask.__bits[i]); + __sys_write(fd, s, strlen(s)); + } + snprintf(s, sizeof(s), "(lo)\n"); + __sys_write(fd, s, strlen(s)); break; } } |