summaryrefslogtreecommitdiffstats
path: root/runtime/transport/procfs.c
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2007-11-04 14:11:15 -0500
committerFrank Ch. Eigler <fche@elastic.org>2007-11-04 14:11:15 -0500
commit806b26a85d30f59af7dcb0025c68a50bf4bbb352 (patch)
tree8b1cc9edab49eda46278199a7027d956549f6ddb /runtime/transport/procfs.c
parent24993e4fcae48ca014e6b53f3f9a011c9cfa8f06 (diff)
parent600e72b28cc0676dc581b8fc5d54c09772979b79 (diff)
downloadsystemtap-steved-806b26a85d30f59af7dcb0025c68a50bf4bbb352.tar.gz
systemtap-steved-806b26a85d30f59af7dcb0025c68a50bf4bbb352.tar.xz
systemtap-steved-806b26a85d30f59af7dcb0025c68a50bf4bbb352.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/transport/procfs.c')
-rw-r--r--runtime/transport/procfs.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/runtime/transport/procfs.c b/runtime/transport/procfs.c
index 88740847..069e379e 100644
--- a/runtime/transport/procfs.c
+++ b/runtime/transport/procfs.c
@@ -324,6 +324,8 @@ static int _stp_ctl_send (int type, void *data, int len)
} else {
while ((err = _stp_ctl_write(type, data, len)) < 0 && trylimit--)
msleep (5);
+ if (err > 0)
+ wake_up_interruptible(&_stp_ctl_wq);
}
return err;
}
@@ -430,23 +432,19 @@ static int _stp_sym_close_cmd (struct inode *inode, struct file *file)
return 0;
}
-static int _stp_ctl_opens = 0;
static int _stp_ctl_open_cmd (struct inode *inode, struct file *file)
{
- /* only allow one reader */
- if (_stp_ctl_opens)
+ if (_stp_attached)
return -1;
- _stp_ctl_opens++;
- _stp_pid = current->pid;
+ _stp_attach();
return 0;
}
static int _stp_ctl_close_cmd (struct inode *inode, struct file *file)
{
- if (_stp_ctl_opens)
- _stp_ctl_opens--;
- _stp_pid = 0;
+ if (_stp_attached)
+ _stp_detach();
return 0;
}