uint64_t volsz;
secaddr pos;
off_t off;
- secaddr start, end;
+ secaddr start, end, last;
const struct event *ev;
const char *device, *outfile;
int opt, blksz;
fp = fopen(optarg, "r");
if (!fp)
bail_syserr(errno, "failed to open ranges file `%s'", optarg);
- i = 0;
+ i = 0; last = -1;
for (;;) {
BUF_REWIND(&buf); if (read_line(fp, &buf)) break;
p = buf.p; i++;
(last <= SECLIMIT && start < last))
bail("bad range `%s' at `%s' line %zu", buf.p, optarg, i);
if (start < end) {
- put_event(EV_WRITE, 0, start);
- put_event(EV_STOP, 0, end);
+ if (start == last)
+ eventq.v[eventq.n - 1].pos = end;
+ else {
+ put_event(EV_WRITE, 0, start);
+ put_event(EV_STOP, 0, end);
+ }
+ last = end;
}
}
if (ferror(fp))