diff options
author | ZyX <kp-pav@yandex.ru> | 2017-11-30 02:02:55 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-11-30 02:02:55 +0300 |
commit | b588ccddd7f5998ce7d9780463480ca844963859 (patch) | |
tree | 78f1e0f58209385aa63e0e25e071a5893635790d /src/nvim/quickfix.c | |
parent | de45ec0146486c49719ff6f6dcceb4914b471c7a (diff) | |
parent | 4618c9c43b2fe052332329b347ac10b4b1db94b5 (diff) | |
download | rneovim-b588ccddd7f5998ce7d9780463480ca844963859.tar.gz rneovim-b588ccddd7f5998ce7d9780463480ca844963859.tar.bz2 rneovim-b588ccddd7f5998ce7d9780463480ca844963859.zip |
Merge branch 'master' into expression-parser
Diffstat (limited to 'src/nvim/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index b9228e15b9..1fc585f0c9 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -570,7 +570,12 @@ static int qf_get_next_file_line(qfstate_T *state) { size_t growbuflen; +retry: + errno = 0; if (fgets((char *)IObuff, IOSIZE, state->fd) == NULL) { + if (errno == EINTR) { + goto retry; + } return QF_END_OF_INPUT; } @@ -590,8 +595,12 @@ static int qf_get_next_file_line(qfstate_T *state) growbuflen = state->linelen; for (;;) { + errno = 0; if (fgets((char *)state->growbuf + growbuflen, (int)(state->growbufsiz - growbuflen), state->fd) == NULL) { + if (errno == EINTR) { + continue; + } break; } state->linelen = STRLEN(state->growbuf + growbuflen); @@ -612,9 +621,14 @@ static int qf_get_next_file_line(qfstate_T *state) while (discard) { // The current line is longer than LINE_MAXLEN, continue reading but // discard everything until EOL or EOF is reached. - if (fgets((char *)IObuff, IOSIZE, state->fd) == NULL - || STRLEN(IObuff) < IOSIZE - 1 - || IObuff[IOSIZE - 1] == '\n') { + errno = 0; + if (fgets((char *)IObuff, IOSIZE, state->fd) == NULL) { + if (errno == EINTR) { + continue; + } + break; + } + if (STRLEN(IObuff) < IOSIZE - 1 || IObuff[IOSIZE - 1] == '\n') { break; } } |