diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-03-09 09:19:25 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-03-09 09:19:25 (GMT) |
commit | 764ef9b409175a603666871249e5991dcb7cbd50 (patch) | |
tree | 8e64debae31f8198926455baff5a0cb81ac35694 | |
parent | c197ddb3b23392d20db4eebe164cab63ec46cfeb (diff) | |
parent | 8aca3246abd4f40476a6f99fce4ee021703a71e7 (diff) | |
download | tcl-764ef9b409175a603666871249e5991dcb7cbd50.zip tcl-764ef9b409175a603666871249e5991dcb7cbd50.tar.gz tcl-764ef9b409175a603666871249e5991dcb7cbd50.tar.bz2 |
Merge 8.6
-rw-r--r-- | unix/tclUnixChan.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index 837aa59..4cb9af0 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -282,12 +282,15 @@ FileInputProc( * nonblocking, the read will never block. */ - bytesRead = read(fsPtr->fd, buf, (size_t) toRead); - if (bytesRead >= 0) { - return bytesRead; + do { + bytesRead = read(fsPtr->fd, buf, (size_t) toRead); + } while ((bytesRead < 0) && (errno == EINTR)); + + if (bytesRead < 0) { + *errorCodePtr = errno; + return -1; } - *errorCodePtr = errno; - return -1; + return bytesRead; } /* |