summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2001-06-07 13:38:31 +0000
committerManuel Novoa III <mjn3@codepoet.org>2001-06-07 13:38:31 +0000
commit000e5cc4360738d57ae0d9bd4267b676df7e56a4 (patch)
tree2bbc162659ef83440dfe9103bc1962b92847e2e4 /libc
parentfde510315baf84e33f689f12c5d21297b5321470 (diff)
Commit _uClibc_fread bug fix (with minor edit) posted by Johan Adolfsson <johan.adolfsson@axis.com>.
Diffstat (limited to 'libc')
-rw-r--r--libc/stdio/stdio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/stdio/stdio.c b/libc/stdio/stdio.c
index d3732dbdb..a42750832 100644
--- a/libc/stdio/stdio.c
+++ b/libc/stdio/stdio.c
@@ -423,8 +423,12 @@ off_t _uClibc_fread(unsigned char *buf, off_t bytes, FILE *fp)
goto FROM_BUF;
}
+ TRY_READ:
len = read(fp->fd, p, (unsigned) bytes);
if (len < 0) {
+ if (errno == EINTR) { /* We were interrupted, so try again. */
+ goto TRY_READ;
+ }
fp->mode |= __MODE_ERR;
} else {
p += len;