From d511650db5b4988e440350ff5cf9229008b03870 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 28 Dec 2019 16:16:10 -0600 Subject: Rename get_chunk()/dump_chunk() to read_chunk()/write_chunk(). --- toys/posix/tail.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'toys/posix/tail.c') diff --git a/toys/posix/tail.c b/toys/posix/tail.c index d7161249..89ec70e8 100644 --- a/toys/posix/tail.c +++ b/toys/posix/tail.c @@ -38,7 +38,7 @@ struct line_list { int len; }; -static struct line_list *get_chunk(int fd, int len) +static struct line_list *read_chunk(int fd, int len) { struct line_list *line = xmalloc(sizeof(struct line_list)+len); @@ -54,7 +54,7 @@ static struct line_list *get_chunk(int fd, int len) return line; } -static void dump_chunk(void *ptr) +static void write_chunk(void *ptr) { struct line_list *list = ptr; @@ -94,7 +94,7 @@ static int try_lseek(int fd, long bytes, long lines) perror_msg("seek failed"); break; } - if (!(temp = get_chunk(fd, chunk))) break; + if (!(temp = read_chunk(fd, chunk))) break; temp->next = list; list = temp; @@ -116,7 +116,7 @@ static int try_lseek(int fd, long bytes, long lines) } // Output stored data - llist_traverse(list, dump_chunk); + llist_traverse(list, write_chunk); // In case of -f lseek(fd, bytes, SEEK_SET); @@ -152,7 +152,7 @@ static void do_tail(int fd, char *name) // Read data until we run out, keep a trailing buffer for (;;) { // Read next page of data, appending to linked list in order - if (!(new = get_chunk(fd, sizeof(toybuf)))) break; + if (!(new = read_chunk(fd, sizeof(toybuf)))) break; dlist_add_nomalloc((void *)&list, (void *)new); // If tracing bytes, add until we have enough, discarding overflow. @@ -192,7 +192,7 @@ static void do_tail(int fd, char *name) } // Output/free the buffer. - llist_traverse(list, dump_chunk); + llist_traverse(list, write_chunk); // Measuring from the beginning of the file. } else for (;;) { -- cgit v1.2.3