Achille Fouilleul pointed out that fdlength wasn't returning the right length in the binary search case.

(This code was originally written for mke2fs, and applies to block devices. The regular file case should just return the length from stat. The ioctl is left commented out in case I want to add back code to check the size of CDROMs without spinning them up again; not sure the sector size is always right these days.)
1 file changed