chiark / gitweb /
dvd-sector-copy.c, dvdrip: Cue prompt to check image from `badblocks' file.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 19 Feb 2022 21:32:13 +0000 (21:32 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 19 Feb 2022 21:32:13 +0000 (21:32 +0000)
The exit status from the final run isn't helpful, but the bad-blocks
file is.

dvd-sector-copy.c
dvdrip

index f70563c57d7b28dd6cedd27086fa1090c0936959..03c2a0c6374bccfb4e2fbff01e2b19d9253553e2 100644 (file)
@@ -524,7 +524,6 @@ static void recovered(secaddr bad_lo, secaddr bad_hi)
   }
   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 {
diff --git a/dvdrip b/dvdrip
index 250e642dc5d9f99ee0fe1fb658ca9aa04ecbb4f0..ad7a280577b334b4f9ebeffab93529b7b992a5ff 100755 (executable)
--- a/dvdrip
+++ b/dvdrip
@@ -151,21 +151,13 @@ case $backup in
   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