summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/relay.c
diff options
context:
space:
mode:
authorDave Brolley <brolley@redhat.com>2009-12-14 16:39:01 -0500
committerDave Brolley <brolley@redhat.com>2009-12-14 16:39:01 -0500
commitb8f1753c091d3f75ea4a71bfb709d8e50780d3fb (patch)
treeea5e83a0556d4df262a2b4f9b26065dc312a8a1e /runtime/staprun/relay.c
parent61b21980212779b5a35f6a196842bdca55a3ced6 (diff)
parent958c58e8231563e9349e4d8ea56c04c25e1501c0 (diff)
downloadsystemtap-steved-b8f1753c091d3f75ea4a71bfb709d8e50780d3fb.tar.gz
systemtap-steved-b8f1753c091d3f75ea4a71bfb709d8e50780d3fb.tar.xz
systemtap-steved-b8f1753c091d3f75ea4a71bfb709d8e50780d3fb.zip
Merge branch 'master' of ssh://sources.redhat.com/git/systemtap
Diffstat (limited to 'runtime/staprun/relay.c')
-rw-r--r--runtime/staprun/relay.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/staprun/relay.c b/runtime/staprun/relay.c
index 59d7ac9a..39a2f393 100644
--- a/runtime/staprun/relay.c
+++ b/runtime/staprun/relay.c
@@ -166,9 +166,9 @@ static void *reader_thread(void *data)
if (stop_threads)
break;
if (switch_file[cpu]) {
- switch_file[cpu] = 0;
if (switch_outfile(cpu, &fnum) < 0)
goto error_out;
+ switch_file[cpu] = 0;
wsize = 0;
}
} else {
@@ -179,9 +179,11 @@ static void *reader_thread(void *data)
while ((rc = read(relay_fd[cpu], buf, sizeof(buf))) > 0) {
/* Switching file */
- if (fsize_max && wsize + rc > fsize_max) {
+ if ((fsize_max && wsize + rc > fsize_max) ||
+ switch_file[cpu]) {
if (switch_outfile(cpu, &fnum) < 0)
goto error_out;
+ switch_file[cpu] = 0;
wsize = 0;
}
if (write(out_fd[cpu], buf, rc) != rc) {