summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/stpd/ChangeLog4
-rw-r--r--runtime/stpd/stpd.c9
2 files changed, 9 insertions, 4 deletions
diff --git a/runtime/stpd/ChangeLog b/runtime/stpd/ChangeLog
index 8151f5be..9233ccd9 100644
--- a/runtime/stpd/ChangeLog
+++ b/runtime/stpd/ChangeLog
@@ -1,3 +1,7 @@
+2006-04-04 Tom Zanussi <zanussi@us.ibm.com>
+
+ * stpd.c (main): Check that /mnt/relay is actually relayfs.
+
2006-03-15 Tom Zanussi <zanussi@us.ibm.com>
* stpd.c (main): Add runtime check for relayfs vs relay-on-proc.
diff --git a/runtime/stpd/stpd.c b/runtime/stpd/stpd.c
index e99f4b47..14107664 100644
--- a/runtime/stpd/stpd.c
+++ b/runtime/stpd/stpd.c
@@ -53,6 +53,7 @@ gid_t cmd_gid;
/* relayfs base file name */
static char stpd_filebase[1024];
+#define RELAYFS_MAGIC 0xF0B4A981
/* if no output file name is specified, use this */
#define DEFAULT_OUTFILE_NAME "probe.out"
@@ -211,11 +212,11 @@ int main(int argc, char **argv)
if (!outfile_name)
outfile_name = DEFAULT_OUTFILE_NAME;
}
-
- if (statfs("/mnt/relay", &st) < 0)
- sprintf(stpd_filebase, "/proc/systemtap/stap_%d/cpu", driver_pid);
- else
+
+ if ((statfs("/mnt/relay", &st) == 0) && (st.f_type == (long) RELAYFS_MAGIC))
sprintf(stpd_filebase, "/mnt/relay/%d/cpu", getpid());
+ else
+ sprintf(stpd_filebase, "/proc/systemtap/stap_%d/cpu", driver_pid);
if (init_stp(stpd_filebase, !quiet)) {
//fprintf(stderr, "Couldn't initialize stpd. Exiting.\n");