From 5aa1f218c5ff8a459c324ac64ee7a9b8046e683d Mon Sep 17 00:00:00 2001 From: Masami Hiramatsu Date: Thu, 2 Apr 2009 18:44:34 -0400 Subject: Fix a bug in file size limitation code. This fixes a bug in stapio, which checks written data size and switches new file when it exceeds a limit. The problem is that written-data-size counter ignores the first written-data size when switching files. So, actual file size always exceeds the limit. This changes stapio to initialize written-data-size counter with the size of the data which will be written in new file. --- runtime/staprun/relay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/staprun/relay.c') diff --git a/runtime/staprun/relay.c b/runtime/staprun/relay.c index 50f295b5..694cb27e 100644 --- a/runtime/staprun/relay.c +++ b/runtime/staprun/relay.c @@ -200,7 +200,7 @@ static void *reader_thread(void *data) perr("Couldn't open file for cpu %d, exiting.", cpu); return(NULL); } - wsize = 0; + wsize = rc; } if (write(out_fd[cpu], buf, rc) != rc) { perr("Couldn't write to output %d for cpu %d, exiting.", out_fd[cpu], cpu); -- cgit