chiark / gitweb /
[PATCH] klibc: strlcpy/strlcat - don't alter destination if size == 0
[elogind.git] / klibc / klibc / fread.c
index 8f7dba9c19f269b77ae7ffdb7c395eeb6fd218fb..a49f0d821088a15dc73599de040cd837cac7c412 100644 (file)
@@ -15,9 +15,10 @@ size_t _fread(void *buf, size_t count, FILE *f)
   while ( count ) {
     rv = read(fileno(f), p, count);
     if ( rv == -1 ) {
-      if ( errno == EINTR )
+      if ( errno == EINTR ) {
+       errno = 0;
        continue;
-      else
+      else
        break;
     } else if ( rv == 0 ) {
       break;