diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2012-06-01 08:04:44 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2012-06-01 08:05:13 -0700 |
commit | 2665746b756bd372ba856e165388dc98032362fd (patch) | |
tree | a5a036e38517d388704fde3b3df22e2607af5fa1 | |
parent | 34e0adabf0cd98eb4d1c4a929acf0b8238fcfbbc (diff) | |
download | grep-2665746b756bd372ba856e165388dc98032362fd.tar.gz |
grep: remove unnecessary "what-if-signal?" code
* src/main.c (fillbuf): Don't worry about EINTR when closing --
not possible, since we're not catching signals.
-rw-r--r-- | src/main.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -601,7 +601,7 @@ reset (int fd, struct stat const *st) static int fillbuf (size_t save, struct stat const *st) { - size_t fillsize = 0; + ssize_t fillsize; int cc = 1; char *readbuf; size_t readsize; @@ -662,18 +662,9 @@ fillbuf (size_t save, struct stat const *st) readsize = buffer + bufalloc - readbuf; readsize -= readsize % pagesize; - if (! fillsize) - { - ssize_t bytesread; - while ((bytesread = read (bufdesc, readbuf, readsize)) < 0 - && errno == EINTR) - continue; - if (bytesread < 0) - cc = 0; - else - fillsize = bytesread; - } - + fillsize = read (bufdesc, readbuf, readsize); + if (fillsize < 0) + fillsize = cc = 0; bufoffset += fillsize; #if defined HAVE_DOS_FILE_CONTENTS if (fillsize) |