summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/relay_old.c
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-06-22 11:37:08 -0400
committerDave Brolley <brolley@redhat.com>2009-06-22 11:37:08 -0400
commitd6454850dd3c9d74b700924b56378c4c9ab9fa57 (patch)
tree6665a24339ca689b1156ea7e93d4f93811c3f794 /runtime/staprun/relay_old.c
parentd729143af5242b17645d3f405141918940680894 (diff)
parent4116c576d5654287b0af598aee4a14eb2af73224 (diff)
downloadsystemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.tar.gz
systemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.tar.xz
systemtap-steved-d6454850dd3c9d74b700924b56378c4c9ab9fa57.zip
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/staprun/relay_old.c')
-rw-r--r--runtime/staprun/relay_old.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/runtime/staprun/relay_old.c b/runtime/staprun/relay_old.c
index 33d2daf3..71d8acee 100644
--- a/runtime/staprun/relay_old.c
+++ b/runtime/staprun/relay_old.c
@@ -87,30 +87,33 @@ static int open_oldoutfile(int fnum, int cpu, int remove_file)
if (fnum_max) {
if (remove_file) {
/* remove oldest file */
- if (make_outfile_name(buf, PATH_MAX, fnum - fnum_max,
- cpu, read_backlog(cpu, fnum - fnum_max)) < 0)
+ if (make_outfile_name(buf, PATH_MAX,
+ fnum - fnum_max, cpu,
+ read_backlog(cpu, fnum - fnum_max),
+ bulkmode) < 0)
return -1;
remove(buf); /* don't care */
}
write_backlog(cpu, fnum, t);
}
- if (make_outfile_name(buf, PATH_MAX, fnum, cpu, t) < 0)
+ if (make_outfile_name(buf, PATH_MAX, fnum, cpu, t, bulkmode) < 0)
return -1;
} else if (bulkmode) {
if (sprintf_chk(buf, "stpd_cpu%d.%d", cpu, fnum))
return -1;
} else { /* stream mode */
- out_fd[cpu] = STDOUT_FILENO;
+ percpu_tmpfile[cpu] = stdout;
return 0;
}
- out_fd[cpu] = open (buf, O_CREAT|O_TRUNC|O_WRONLY, 0666);
- if (out_fd[cpu] < 0) {
+ if((percpu_tmpfile[cpu] = fopen(buf, "w+")) == NULL) {
perr("Couldn't open output file %s", buf);
return -1;
}
- if (set_clexec(out_fd[cpu]) < 0)
+ if (set_clexec(fileno(percpu_tmpfile[cpu])) < 0) {
+ perr("Couldn't clear exec bit of open output file %s", buf);
return -1;
+ }
return 0;
}
/**