RPM

Comment 7 for bug 913203

Revision history for this message
In , Pascal Terjan (pterjan42) wrote :

I tried to debug it, it seems headerRead expects timedRead(fd, (char *)&ei[2], len) to always read the full requested size but it does not (it often only gets 4992 bytes).

Just to test I changed the code to be

    if ((a=timedRead(fd, (char *)&ei[2], len)) != len) {
        int p = 0;
        while ((a > 0) && (a < len)) {
                len -= a;
                p += a;
                a = timedRead(fd, (char *)&ei[2]+p, len);
        }
        if (a < len) {
                goto exit;
        }
    }

And it can now load all the headers.