diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2009-01-24 13:58:35 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2009-01-24 13:58:35 +0100 |
commit | b4d83d2e6ae0ec475371ca0fd400e72edc539710 (patch) | |
tree | 6e80738e6b5ff1673f984174392ec8a8dd7b032f /inotail.c | |
parent | f6ae74eb0e94facb9fea8002ea86b5af1f6e593e (diff) |
Move linked list structs for pipe_{bytes,lines} into these functions
Diffstat (limited to 'inotail.c')
-rw-r--r-- | inotail.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -289,7 +289,12 @@ static int tail_pipe_from_begin(struct file_struct *f, unsigned long n_units, co static int tail_pipe_lines(struct file_struct *f, unsigned long n_lines) { - struct line_buf *first, *last, *tmp; + struct line_buf { + char buf[BUFSIZ]; + size_t n_lines; + size_t n_bytes; + struct line_buf *next; + } *first, *last, *tmp; int rc; unsigned long total_lines = 0; const char *p; @@ -404,7 +409,11 @@ out: /* TODO: Merge some parts (especially buffer handling) with tail_pipe_lines() */ static int tail_pipe_bytes(struct file_struct *f, unsigned long n_bytes) { - struct char_buf *first, *last, *tmp; + struct char_buf { + char buf[BUFSIZ]; + size_t n_bytes; + struct char_buf *next; + } *first, *last, *tmp; int rc; unsigned long total_bytes = 0; unsigned long i = 0; /* Index into buffer */ |