summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/stpd/ChangeLog6
-rw-r--r--runtime/stpd/librelay.c5
-rw-r--r--runtime/stpd/stpd.c7
3 files changed, 12 insertions, 6 deletions
diff --git a/runtime/stpd/ChangeLog b/runtime/stpd/ChangeLog
index 18573c6f..813f566f 100644
--- a/runtime/stpd/ChangeLog
+++ b/runtime/stpd/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-05 Martin Hunt <hunt@redhat.com>
+
+ * librelay.c (merge_output): Set the output filename if necessary.
+ * stpd.c (main): Don't reset output_filename just because
+ relayfs is possible. Move that code to librelay.c.
+
2006-04-04 Roland McGrath <roland@redhat.com>
* stpd.c (main): Cast f_type when comparing; type differs by machine.
diff --git a/runtime/stpd/librelay.c b/runtime/stpd/librelay.c
index cbc5b5a5..e1d9e499 100644
--- a/runtime/stpd/librelay.c
+++ b/runtime/stpd/librelay.c
@@ -59,6 +59,8 @@ static char proc_filebase[128];
static int proc_file[NR_CPUS];
/* probe output written here, if non-NULL */
+/* if no output file name is specified, use this */
+#define DEFAULT_RELAYFS_OUTFILE_NAME "probe.out"
extern char *outfile_name;
/* internal variables */
@@ -577,6 +579,9 @@ static int merge_output(void)
num[i] = 0;
}
+ if (!outfile_name)
+ outfile_name = DEFAULT_RELAYFS_OUTFILE_NAME;
+
ofp = fopen (outfile_name, "w");
if (!ofp) {
fprintf (stderr, "ERROR: couldn't open output file %s: errcode = %s\n",
diff --git a/runtime/stpd/stpd.c b/runtime/stpd/stpd.c
index 54447b56..0b36fbb7 100644
--- a/runtime/stpd/stpd.c
+++ b/runtime/stpd/stpd.c
@@ -55,9 +55,6 @@ gid_t cmd_gid;
static char stpd_filebase[1024];
#define RELAYFS_MAGIC 0xF0B4A981
-/* if no output file name is specified, use this */
-#define DEFAULT_OUTFILE_NAME "probe.out"
-
/* stp_check script */
#ifdef PKGLIBDIR
char *stp_check=PKGLIBDIR "/stp_check";
@@ -91,7 +88,7 @@ int main(int argc, char **argv)
int c, status;
pid_t pid;
struct statfs st;
-
+
while ((c = getopt(argc, argv, "mpqrb:n:t:d:c:vo:u:")) != EOF)
{
switch (c) {
@@ -209,8 +206,6 @@ int main(int argc, char **argv)
fprintf(stderr, "Could not execute %s\n", stp_check);
exit(1);
}
- if (!outfile_name)
- outfile_name = DEFAULT_OUTFILE_NAME;
}
if (statfs("/mnt/relay", &st) == 0