}
if (lseek(outfd, (off_t)(bad_hi - bad_lo)*SECTORSZ, SEEK_CUR) < 0)
bail_syserr(errno, "failed to seek past bad sectors");
- status = 1;
}
struct recoverybuf {
nil)
if [ ! -f "$tmp/$tag/iso" ]; then
accumulate_badblocks
- run_setrc "$DVD_SECTOR_COPY" -c -b"$tmp/$tag/badblocks.new" \
- "$dev" "$tmp/$tag/iso.new"
+ run "$DVD_SECTOR_COPY" -c -b"$tmp/$tag/badblocks.new" \
+ "$dev" "$tmp/$tag/iso.new"
+ run mv "$tmp/$tag/iso.new" "$tmp/$tag/iso"
accumulate_badblocks
- case $rc in
- 0)
- run mv "$tmp/$tag/iso.new" "$tmp/$tag/iso"
- ;;
- 1)
- run mv "$tmp/$tag/iso.new" "$tmp/$tag/iso"
- fail "bad sectors found: check \`$tmp/$tag/iso', run again if ok"
- ;;
- *)
- fail "$DVD_SECTOR_COPY: exit $rc"
- ;;
- esac
+ if [ -f "$tmp/$tag/badblocks" ]; then
+ fail "bad sectors found: check \`$tmp/$tag/iso', run again if ok"
+ fi
fi
;;
esac