diff options
Diffstat (limited to 'evspy-core.c')
-rw-r--r-- | evspy-core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/evspy-core.c b/evspy-core.c index 650015e..b0c0d4b 100644 --- a/evspy-core.c +++ b/evspy-core.c @@ -50,12 +50,12 @@ static int evspy_read_proc(char *page, char **start, off_t offset, int count, return -EPERM; #endif } else { // copy fifo contents to the supplied buffer - n = kfifo_out(&cbuffer, page, count); - - if (kfifo_is_empty(&cbuffer)) + if (offset > 0) { *eof = 1; - - return n; + return 0; + } else { + return kfifo_out(&cbuffer, page, min((int)PAGE_SIZE, count)); + } } } |