Skip to content

Commit 0c921f6

Browse files
committed
remote: handle EINTR error
In the case of an interrupt, try reading the data again. This may not be the most considerate thing to do, but it will read th data.
1 parent 93c5b5c commit 0c921f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/CL/devices/remote/communication.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,12 @@ connection_read_full (remote_connection_t *connection,
319319
res = read (connection->fd, ptr + readb, remain);
320320
if (res < 0)
321321
{ /* ERROR */
322+
323+
/* In the case of a system interrupt, try again. */
324+
if (errno == EINTR)
325+
continue;
326+
POCL_MSG_ERR ("error reading remote data: %d (%s).\n", errno,
327+
strerror (errno));
322328
return -1;
323329
}
324330
if (res == 0)

0 commit comments

Comments
 (0)