diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2006-11-17 14:52:38 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2006-11-17 14:52:38 +0000 |
commit | dbf989ea6ae009683f855e0a802002fafad2b723 (patch) | |
tree | ceab6664c981374fe24ec69ddb326a65741460bc /sys/fs/procfs | |
parent | 1ea7de37f9e9fe8b3c63cd219502454cbbfdc2fa (diff) | |
download | src-dbf989ea6ae009683f855e0a802002fafad2b723.tar.gz src-dbf989ea6ae009683f855e0a802002fafad2b723.zip |
Wake up PIOCWAIT handler on the process exit in addition to the stop
events. &p->p_stype is explicitely woken up on process exit for us.
Now, truss /nonexistent exits with error instead of waiting until killed
by signal.
Reported by: Nikos Vassiliadis nvass at teledomenet gr
Reviewed by: jhb
MFC after: 1 week
Notes
Notes:
svn path=/head/; revision=164356
Diffstat (limited to 'sys/fs/procfs')
-rw-r--r-- | sys/fs/procfs/procfs_ioctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/fs/procfs/procfs_ioctl.c b/sys/fs/procfs/procfs_ioctl.c index 04fe603297be..d737d96a4a13 100644 --- a/sys/fs/procfs/procfs_ioctl.c +++ b/sys/fs/procfs/procfs_ioctl.c @@ -124,7 +124,7 @@ procfs_ioctl(PFS_IOCTL_ARGS) *(unsigned int *)data = p->p_pfsflags; break; case PIOCWAIT: - while (p->p_step == 0) { + while (p->p_step == 0 && (p->p_flag & P_WEXIT) == 0) { /* sleep until p stops */ error = msleep(&p->p_stype, &p->p_mtx, PWAIT|PCATCH, "pioctl", 0); @@ -142,7 +142,7 @@ procfs_ioctl(PFS_IOCTL_ARGS) break; #ifdef COMPAT_IA32 case PIOCWAIT32: - while (p->p_step == 0) { + while (p->p_step == 0 && (p->p_flag & P_WEXIT) == 0) { /* sleep until p stops */ error = msleep(&p->p_stype, &p->p_mtx, PWAIT|PCATCH, "pioctl", 0); |