The read call may fail if it is interrupted by a signal. Do not assume
that we have reached the end of the underlying block device because of
this. Use read_all which retries in these cases.
Signed-off-by: Samanta Navarro <ferivoz@riseup.net>
# define EBADFD 77 /* File descriptor in bad state */
#endif
+#include "all-io.h"
#include "blkdev.h"
#include "c.h"
#include "linux_version.h"
if (lseek (fd, offset, 0) < 0)
return 0;
- if (read (fd, &ch, 1) < 1)
+ if (read_all (fd, &ch, 1) < 1)
return 0;
return 1;
}