[erlang-patches] Re: [PATCH] file: fix hang reading compressed files

Henrik Nord henrik@REDACTED
Thu Apr 7 10:30:41 CEST 2011


Hi
Your patch has come up with feedback



The fix looks OK, but the name 'offset' is confusing since there is
another 'offset' also in context. Rename to e.g 'save_pos':

@@ -632,6 +632,7 @@ erts_gzseek(gzFile file, int offset, int whence)
      while (s->position<  pos) {
  	char buf[512];
  	int n;
+	int offset = s->position;

  	n = pos - s->position;
  	if (n>  sizeof(buf))
@@ -643,6 +644,7 @@ erts_gzseek(gzFile file, int offset, int whence)
  	    memset(buf, '\0', n);
  	    erts_gzwrite(file, buf, n);
  	}
+	if (offset == s->position) break;
      }

      return s->position;


Thank you


-- 
/Henrik Nord Erlang/OTP




More information about the erlang-patches mailing list