summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2001-03-29 18:10:46 +0000
committerjhb <jhb@FreeBSD.org>2001-03-29 18:10:46 +0000
commit35bb2b40ac77dd2153881ec89606767899a97f15 (patch)
treee70493dd62fab3575db13c23d428b7ffe7e8087c /sys/fs
parent84b9a94fb61f990fbc8edbc30c5345755409d05f (diff)
downloadFreeBSD-src-35bb2b40ac77dd2153881ec89606767899a97f15.zip
FreeBSD-src-35bb2b40ac77dd2153881ec89606767899a97f15.tar.gz
- Various style fixes.
- Fix a silly bug so that we return the actual error code if a procfs attach fails rather than always returning 0. Reported by: bde
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/procfs/procfs_ctl.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/fs/procfs/procfs_ctl.c b/sys/fs/procfs/procfs_ctl.c
index 6a20cc6..f0a5427 100644
--- a/sys/fs/procfs/procfs_ctl.c
+++ b/sys/fs/procfs/procfs_ctl.c
@@ -35,8 +35,6 @@
* SUCH DAMAGE.
*
* @(#)procfs_ctl.c 8.4 (Berkeley) 6/15/94
- *
- * From:
* $FreeBSD$
*/
@@ -128,13 +126,12 @@ procfs_control(curp, p, op)
if (op == PROCFS_CTL_ATTACH) {
sx_xlock(&proctree_lock);
PROC_LOCK(p);
- /* check whether already being traced */
if (p->p_flag & P_TRACED) {
error = EBUSY;
goto out;
}
- /* can't trace yourself! */
+ /* Can't trace yourself! */
if (p->p_pid == curp->p_pid) {
error = EINVAL;
goto out;
@@ -156,10 +153,10 @@ procfs_control(curp, p, op)
proc_reparent(p, curp);
}
psignal(p, SIGSTOP);
- out:
+out:
PROC_UNLOCK(p);
sx_xunlock(&proctree_lock);
- return (0);
+ return (error);
}
/*
@@ -266,7 +263,6 @@ procfs_control(curp, p, op)
* to enter
*/
case PROCFS_CTL_WAIT:
- error = 0;
if (p->p_flag & P_TRACED) {
mtx_lock_spin(&sched_lock);
while (error == 0 &&
OpenPOWER on IntegriCloud