summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/mainloop.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/mainloop.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/mainloop.c')
-rw-r--r--runtime/staprun/mainloop.c39
1 files changed, 2 insertions, 37 deletions
diff --git a/runtime/staprun/mainloop.c b/runtime/staprun/mainloop.c
index f0952f86..d919164f 100644
--- a/runtime/staprun/mainloop.c
+++ b/runtime/staprun/mainloop.c
@@ -118,38 +118,6 @@ void system_cmd(char *cmd)
}
}
-static int using_old_transport(void)
-{
- struct utsname utsbuf;
- int i;
- long int kver[3];
- char *start, *end;
-
- if (uname(&utsbuf) != 0) {
- _perr("Unable to determine kernel version, uname failed");
- return -1;
- }
-
- start = utsbuf.release;
- for (i = 0; i < 3; i++) {
- errno = 0;
- kver[i] = strtol(start, &end, 10);
- if (errno != 0) {
- _perr("Unable to parse kernel version, strtol failed");
- return -1;
- }
- start = end;
- start++;
- }
-
- if (KERNEL_VERSION(kver[0], kver[1], kver[2])
- <= KERNEL_VERSION(2, 6, 15)) {
- dbug(2, "Using OLD TRANSPORT\n");
- return 1;
- }
- return 0;
-}
-
/* This is only used in the old relayfs code */
static void read_buffer_info(void)
{
@@ -195,12 +163,9 @@ int init_stapio(void)
{
dbug(2, "init_stapio\n");
- use_old_transport = using_old_transport();
- if (use_old_transport < 0)
- return -1;
-
/* create control channel */
- if (init_ctl_channel() < 0) {
+ use_old_transport = init_ctl_channel();
+ if (use_old_transport < 0) {
err("Failed to initialize control channel.\n");
return -1;
}