summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-02-23 12:35:19 +0000
committerEric Andersen <andersen@codepoet.org>2002-02-23 12:35:19 +0000
commit8ff9477238020917610c48f790f522b48fe5a169 (patch)
treec00c6967747c95300c4053b7507b0e860c1f808d
parentc668edc1a46dc0822745b36d1c7c44c3c23d0e2c (diff)
IEEE Std 1003.1-2001 says that the "fclose() function shall fail [with]
EINTR [when] the fclose() function was interrupted by a signal". But looking in the current uClibc stdio.c for some bizarre reason we had a special case where when errno was EINTR, we would keep on trying instead. Doh! Fix that, -Erik
-rw-r--r--libc/stdio/stdio.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/libc/stdio/stdio.c b/libc/stdio/stdio.c
index eb2961f37..3f475aec0 100644
--- a/libc/stdio/stdio.c
+++ b/libc/stdio/stdio.c
@@ -439,12 +439,8 @@ 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;
@@ -549,9 +545,7 @@ off_t _uClibc_fwrite(const unsigned char *buf, off_t bytes, FILE *fp)
while (bytes) {
if ((rv = write(fp->fd, p, bytes)) < 0) {
rv = 0;
- if (errno != EINTR) {
- break;
- }
+ break;
}
p += rv;
bytes -= rv;