]> Git Repo - uclibc-ng.git/commitdiff
IEEE Std 1003.1-2001 says that the "fclose() function shall fail [with]
authorEric Andersen <[email protected]>
Sat, 23 Feb 2002 12:35:19 +0000 (12:35 -0000)
committerEric Andersen <[email protected]>
Sat, 23 Feb 2002 12:35:19 +0000 (12:35 -0000)
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

libc/stdio/stdio.c

index eb2961f3766709f9a1b7100820824db29ec78cce..3f475aec0d1ca4cc8d7250282181f4d0d689a19f 100644 (file)
@@ -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;
This page took 0.030314 seconds and 4 git commands to generate.