summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/ctl.c
diff options
context:
space:
mode:
authorhunt <hunt>2007-09-14 16:11:12 +0000
committerhunt <hunt>2007-09-14 16:11:12 +0000
commitb38d9a7d9219f6bc2ea04219d87575ab127bb32e (patch)
treef40b01efdd6d0fd3357bb90c8ba2f1713c15ee90 /runtime/staprun/ctl.c
parentbcf31db437b07b22f1bda965e980b5c98442b163 (diff)
downloadsystemtap-steved-b38d9a7d9219f6bc2ea04219d87575ab127bb32e.tar.gz
systemtap-steved-b38d9a7d9219f6bc2ea04219d87575ab127bb32e.tar.xz
systemtap-steved-b38d9a7d9219f6bc2ea04219d87575ab127bb32e.zip
2007-09-14 Martin Hunt <hunt@redhat.com>
* ctl.c (init_ctl_channel): Return 1 if the ctl file opened was for the old relayfs transport. * mainloop.c (init_stapio): Don't call using_old_transport(). Use the return of init_ctl_channel() instead. (using_old_transport): Deleted.
Diffstat (limited to 'runtime/staprun/ctl.c')
-rw-r--r--runtime/staprun/ctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/staprun/ctl.c b/runtime/staprun/ctl.c
index 72592bdf..d0b07260 100644
--- a/runtime/staprun/ctl.c
+++ b/runtime/staprun/ctl.c
@@ -16,11 +16,13 @@ int init_ctl_channel(void)
{
char buf[PATH_MAX];
struct statfs st;
+ int old_transport = 0;
if (statfs("/sys/kernel/debug", &st) == 0 && (int) st.f_type == (int) DEBUGFS_MAGIC) {
if (sprintf_chk(buf, "/sys/kernel/debug/systemtap/%s/cmd", modname))
return -1;
} else {
+ old_transport = 1;
if (sprintf_chk(buf, "/proc/systemtap/%s/cmd", modname))
return -1;
}
@@ -34,7 +36,7 @@ int init_ctl_channel(void)
perr("Couldn't open control channel '%s'", buf);
return -1;
}
- return 0;
+ return old_transport;
}
void close_ctl_channel(void)