From: schwarze Date: Sat, 7 Aug 2021 12:41:51 +0000 (+0000) Subject: Bugfix: X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c95b935146d1c3e1b2fdbbe5ff98ec3a500f9f8f;p=openbsd Bugfix: Delete ugly and incorrect workaround for a Linux kernel bug. If a file is temporarily empty, that by no means implies it might be permanently non-seekable. Patch from seL4 at disroot dot org on tech@. OK both Theos: tb@ and deraadt@ --- diff --git a/usr.bin/less/ch.c b/usr.bin/less/ch.c index 1a679767a42..d7c0aa34e90 100644 --- a/usr.bin/less/ch.c +++ b/usr.bin/less/ch.c @@ -643,19 +643,6 @@ ch_flush(void) ch_block = 0; /* ch_fpos / LBUFSIZE; */ ch_offset = 0; /* ch_fpos % LBUFSIZE; */ -#if 1 - /* - * This is a kludge to workaround a Linux kernel bug: files in - * /proc have a size of 0 according to fstat() but have readable - * data. They are sometimes, but not always, seekable. - * Force them to be non-seekable here. - */ - if (ch_fsize == 0) { - ch_fsize = -1; - ch_flags &= ~CH_CANSEEK; - } -#endif - if (lseek(ch_file, (off_t)0, SEEK_SET) == (off_t)-1) { /* * Warning only; even if the seek fails for some reason,