X-Git-Url: https://git.distorted.org.uk/~mdw/dvdrip/blobdiff_plain/3b455ee5df3b567d76cd1ca024fc01a028ef8855..9ac85bf50faee7ec55c250a4efa7b4291d2a036a:/dvd-sector-copy.c diff --git a/dvd-sector-copy.c b/dvd-sector-copy.c index b0cd78d..dceab3f 100644 --- a/dvd-sector-copy.c +++ b/dvd-sector-copy.c @@ -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();