read(2) and write(2) don’t EINTR for fast input (LP#1616692)

This commit is contained in:
tg 2016-08-25 16:21:14 +00:00
parent fa94f0339e
commit 61969809e4

View File

@ -38,7 +38,7 @@
#endif #endif
#endif #endif
__RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.305 2016/08/01 21:38:02 tg Exp $"); __RCSID("$MirOS: src/bin/mksh/funcs.c,v 1.306 2016/08/25 16:21:14 tg Exp $");
#if HAVE_KILLPG #if HAVE_KILLPG
/* /*
@ -3776,12 +3776,15 @@ c_cat(const char **wp)
/* end of file reached */ /* end of file reached */
break; break;
while (n) { while (n) {
if (intrsig)
goto has_intrsig;
if ((w = write(STDOUT_FILENO, cp, n)) != -1) { if ((w = write(STDOUT_FILENO, cp, n)) != -1) {
n -= w; n -= w;
cp += w; cp += w;
continue; continue;
} }
if (errno == EINTR) { if (errno == EINTR) {
has_intrsig:
restore_pipe(opipe); restore_pipe(opipe);
/* give the user a chance to ^C out */ /* give the user a chance to ^C out */
intrcheck(); intrcheck();