diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-04-14 08:47:53 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-04-14 08:47:53 (GMT) |
commit | 7f42387e71a69b938ecd25945d10f01f6e39bcc7 (patch) | |
tree | d6de8446022309740483d0f2db7f089749623f34 /unix/tclUnixChan.c | |
parent | 9ffcf83c49f17eca5cd2005902d378ac59aa7adf (diff) | |
parent | ccfe3f47fd0a170a819d29e0b22bba0003546796 (diff) | |
download | tcl-7f42387e71a69b938ecd25945d10f01f6e39bcc7.zip tcl-7f42387e71a69b938ecd25945d10f01f6e39bcc7.tar.gz tcl-7f42387e71a69b938ecd25945d10f01f6e39bcc7.tar.bz2 |
Merge 8.7
Diffstat (limited to 'unix/tclUnixChan.c')
-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; } /* |