Browse Source

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

Eric Andersen 23 years ago
parent
commit
8ff9477238
1 changed files with 1 additions and 7 deletions
  1. 1 7
      libc/stdio/stdio.c

+ 1 - 7
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;