diff options
author | Tim Moore <timoore@redhat.com> | 2009-12-03 23:48:34 +0100 |
---|---|---|
committer | Tim Moore <timoore@redhat.com> | 2009-12-03 23:48:34 +0100 |
commit | 388924acea820c7a1328eb2ac8a4128437853c3a (patch) | |
tree | 20b7c30a6fa8707ee7d0932f3ef2811e9ded104f /runtime/staprun/relay.c | |
parent | 457a91c061a1658648fc155504795bf6f4c44740 (diff) | |
parent | 5cd2f827aa03091c7d1832c9734827d8caff732d (diff) | |
download | systemtap-steved-388924acea820c7a1328eb2ac8a4128437853c3a.tar.gz systemtap-steved-388924acea820c7a1328eb2ac8a4128437853c3a.tar.xz systemtap-steved-388924acea820c7a1328eb2ac8a4128437853c3a.zip |
Merge commit 'origin/master'
Diffstat (limited to 'runtime/staprun/relay.c')
-rw-r--r-- | runtime/staprun/relay.c | 6 |
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) { |