dvd-sector-copy.c: Make `outfd' be global variable.
[dvdrip] / dvd-sector-copy.c
index b0cd78d..dceab3f 100644 (file)
@@ -382,7 +382,7 @@ static void report_bad_blocks_progress(secaddr lo, secaddr hi, int err)
 }
 
 static dvd_reader_t *dvd;
-static int dvdfd = -1;
+static int dvdfd = -1, outfd = -1;
 static dvd_file_t *vob;
 static const char *mapfile; static FILE *mapfp;
 
@@ -407,7 +407,7 @@ again:
   return (n);
 }
 
-static void emit(int outfd, secaddr start, secaddr end)
+static void emit(secaddr start, secaddr end)
 {
 #define BUFSECTORS 512
 
@@ -605,7 +605,7 @@ int main(int argc, char *argv[])
   unsigned long start, end;
   const struct event *ev;
   const char *device = "/dev/dvd", *outfile = 0;
-  int opt, err, outfd = -1, blksz;
+  int opt, blksz;
   unsigned n;
   size_t i;
   FILE *fp;
@@ -812,7 +812,7 @@ int main(int argc, char *argv[])
   for (pos = 0, i = 0; i < eventq.n; i++) {
     ev = &eventq.v[i];
     if (ev->pos > pos) {
-      if (f&f_write) emit(outfd, pos, ev->pos);
+      if (f&f_write) emit(pos, ev->pos);
       pos = ev->pos;
 #ifdef DEBUG
       clear_progress();