chkdvdimg.c: Open the image file with `open_dvd'.
authorMark Wooding <mdw@distorted.org.uk>
Tue, 22 Mar 2022 21:37:27 +0000 (21:37 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Tue, 22 Mar 2022 21:37:27 +0000 (21:37 +0000)
This means that it will wait until we actually insert a disc.  Yay!

chkdvdimg.c

index 623c50f..05fa7e1 100644 (file)
@@ -102,9 +102,7 @@ static void check_img(const char *file)
   secaddr end;
   unsigned i, j;
 
-  fd = open(file, (flags&F_FIX) ? O_RDWR : O_RDONLY);
-  if (fd < 0)
-    { gripe_syserr(2, errno, "failed to open `%s'", file); goto end; }
+  open_dvd(file, (flags&F_FIX) ? O_RDWR : O_RDONLY, &fd, 0);
   blksz = SECTORSZ; volsz = device_size(fd, file, &blksz);
   if (SECTORSZ != 2048)
     { gripe(2, "device sector size %d /= 2048", blksz); goto end; }
@@ -193,7 +191,9 @@ int main(int argc, char *argv[])
   }
   if (optind >= argc) f |= f_bogus;
   if (f&f_bogus) { usage(stderr); exit(2); }
-
+  setlocale(LC_ALL, "");
+  progress_init(&progress);
   for (i = optind; i < argc; i++) check_img(argv[i]);
+  progress_free(&progress);
   return (status);
 }