summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixChan.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tclUnixChan.c')
-rw-r--r--unix/tclUnixChan.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c
index fc01616..b49dde7 100644
--- a/unix/tclUnixChan.c
+++ b/unix/tclUnixChan.c
@@ -253,12 +253,15 @@ FileInputProc(
* nonblocking, the read will never block.
*/
- bytesRead = read(fsPtr->fd, buf, (size_t) toRead);
- if (bytesRead > -1) {
- 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;
}
/*