summaryrefslogtreecommitdiff
path: root/usr/src/cmd/stat/iostat
diff options
context:
space:
mode:
authoras158974 <none@none>2006-12-23 00:42:25 -0800
committeras158974 <none@none>2006-12-23 00:42:25 -0800
commitc2c72096061068f51f231cbfe24cbc770bd81041 (patch)
tree0ec25df887347df2b5a9ad908763dea84722c8ee /usr/src/cmd/stat/iostat
parentd30f914e9eb88d81d231fd459303c09dd0fd8808 (diff)
downloadillumos-joyent-c2c72096061068f51f231cbfe24cbc770bd81041.tar.gz
6462151 iostat can hang if parent process has blocked SIGUSR1
Diffstat (limited to 'usr/src/cmd/stat/iostat')
-rw-r--r--usr/src/cmd/stat/iostat/iostat.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr/src/cmd/stat/iostat/iostat.c b/usr/src/cmd/stat/iostat/iostat.c
index c26080eed9..0507d21883 100644
--- a/usr/src/cmd/stat/iostat/iostat.c
+++ b/usr/src/cmd/stat/iostat/iostat.c
@@ -18,6 +18,7 @@
*
* CDDL HEADER END
*/
+
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
@@ -1732,10 +1733,16 @@ set_timer(int interval)
itimerspec_t time_struct;
struct sigevent sig_struct;
struct sigaction act;
+ sigset_t sig_set;
bzero(&sig_struct, sizeof (struct sigevent));
bzero(&act, sizeof (struct sigaction));
+ /* Ensure that our signal is unblocked. */
+ (void) sigemptyset(&sig_set);
+ (void) sigaddset(&sig_set, SIGUSR1);
+ (void) sigprocmask(SIG_UNBLOCK, &sig_set, NULL);
+
/* Create timer */
sig_struct.sigev_notify = SIGEV_SIGNAL;
sig_struct.sigev_signo = SIGUSR1;