From 91a7b57fa4e2d633563192d5c2b47f6042d2ea49 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 20 Jan 2007 18:37:18 +0100 Subject: inotail.c: Adjust block size according to return value of read ...and use proper types --- inotail.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'inotail.c') diff --git a/inotail.c b/inotail.c index 724c471..8695855 100644 --- a/inotail.c +++ b/inotail.c @@ -157,8 +157,8 @@ static off_t lines_to_offset_from_begin(struct file_struct *f, unsigned int n_li memset(&buf, 0, sizeof(buf)); while (offset <= f->st_size && n_lines > 0) { - int i, rc; - int block_size = BUFFER_SIZE; + int i; + ssize_t rc, block_size = BUFFER_SIZE; lseek(f->fd, offset, SEEK_SET); @@ -166,7 +166,8 @@ static off_t lines_to_offset_from_begin(struct file_struct *f, unsigned int n_li if (rc < 0) { fprintf(stderr, "Error: Could not read from file '%s' (%s)\n", f->name, strerror(errno)); return -1; - } + } else if (rc < block_size) + block_size = rc; for (i = 0; i < block_size; i++) { if (buf[i] == '\n') { -- cgit v1.2.3-54-g00ecf on value='emaclite-cleanup'>emaclite-cleanup net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
path: root/Documentation/translations
diff options
context:
space:
mode:
authorAndrew F. Davis <afd@ti.com>2016-05-04 17:01:37 -0500
committerBjorn Andersson <bjorn.andersson@linaro.org>2016-05-06 11:09:00 -0700
commit9122bf1839c039a0052c0a75a3c4daf9277b5dd5 (patch)
tree58866b413b23e8f0888bbfea1ecee955019c3537 /Documentation/translations
parentbc3c57c13256c748a4e71d2ea7481d0c953e88e1 (diff)
rpmsg: drop owner assignment from rpmsg_drivers
An rpmsg_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Andrew F. Davis <afd@ti.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'Documentation/translations')