> - if (pread(fd, phdr, size, ehdr.e_phoff) != size) { > + if ((nr = pread(fd, phdr, size, ehdr.e_phoff)) != -1) {
did you intend to check for == -1? > warn("read(%s)", name); should that not say pread?
> - if (pread(fd, phdr, size, ehdr.e_phoff) != size) { > + if ((nr = pread(fd, phdr, size, ehdr.e_phoff)) != -1) {
did you intend to check for == -1? > warn("read(%s)", name); should that not say pread?