From 80bfc295ef61177de618172b557d44c8e7aa3eb5 Mon Sep 17 00:00:00 2001 From: Xin LI Date: Thu, 29 Jun 2017 06:28:54 +0000 Subject: [PATCH] Don't bother to set target for SEEK_END. While there also collapase SEEK_END into default case in lseek. MFC after: 2 weeks --- lib/libstand/bzipfs.c | 2 -- lib/libstand/gzipfs.c | 2 -- lib/libstand/lseek.c | 1 - 3 files changed, 5 deletions(-) diff --git a/lib/libstand/bzipfs.c b/lib/libstand/bzipfs.c index b0176080dad..ff1514efeed 100644 --- a/lib/libstand/bzipfs.c +++ b/lib/libstand/bzipfs.c @@ -320,8 +320,6 @@ bzf_seek(struct open_file *f, off_t offset, int where) case SEEK_CUR: target = offset + bzf->bzf_bzstream.total_out_lo32; break; - case SEEK_END: - target = -1; default: errno = EINVAL; return(-1); diff --git a/lib/libstand/gzipfs.c b/lib/libstand/gzipfs.c index 9b51e2d0432..6057c2835fe 100644 --- a/lib/libstand/gzipfs.c +++ b/lib/libstand/gzipfs.c @@ -300,8 +300,6 @@ zf_seek(struct open_file *f, off_t offset, int where) case SEEK_CUR: target = offset + zf->zf_zstream.total_out; break; - case SEEK_END: - target = -1; default: errno = EINVAL; return(-1); diff --git a/lib/libstand/lseek.c b/lib/libstand/lseek.c index 5457b64e392..df2591acd76 100644 --- a/lib/libstand/lseek.c +++ b/lib/libstand/lseek.c @@ -87,7 +87,6 @@ lseek(int fd, off_t offset, int where) case SEEK_CUR: f->f_offset += offset; break; - case SEEK_END: default: errno = EOFFSET; return (-1);