lib.h: Add missing documentation of FILE argument to `device_size'.
[dvdrip] / dvd-sector-copy.c
index 6f14bb5..f1f6d4e 100644 (file)
@@ -8,30 +8,6 @@ static void usage(FILE *fp)
          prog);
 }
 
-static double tvdiff(const struct timeval *tv_lo,
-                    const struct timeval *tv_hi)
-{
-  return ((tv_hi->tv_sec - tv_lo->tv_sec) +
-         (tv_hi->tv_usec - tv_lo->tv_usec)/1.0e6);
-}
-
-#define DEFVEC(vtype, etype)                                           \
-       typedef struct { etype *v; size_t n, sz; } vtype
-#define VEC_INIT { 0, 0, 0 }
-#define VEC_FREE(vv) do {                                              \
-  free((vv)->v); (vv)->v 0; (vv)->n = (vv)->sz = 0;                    \
-} while (0)
-#define VEC_PUSH(p, vv) do {                                           \
-  size_t _want;                                                                \
-  if ((vv)->n >= (vv)->sz) {                                           \
-    (vv)->sz = (vv)->sz ? 2*(vv)->sz : 32;                             \
-    _want = (vv)->sz*sizeof(*(vv)->v);                                 \
-    (vv)->v = realloc((vv)->v, _want);                                 \
-    if (!(vv)->v) bail("out of memory allocating %zu bytes", _want);   \
-  }                                                                    \
-  (p) = &(vv)->v[(vv)->n++];                                           \
-} while (0)
-
 #define MAXFILES (1 + 2*99 + 1)
 struct file {
   ident id;
@@ -347,7 +323,10 @@ static ssize_t read_sectors(secaddr pos, void *buf, secaddr want)
 #endif
       if (pos < bad->start) { D( printf("high\n"); ) best = bad; hi = mid; }
       else if (pos >= bad->end) { D( printf("low\n"); ) lo = mid + 1; }
-      else { D( printf("match!\n"); ) errno = EIO; return (-1); }
+      else {
+       D( printf("match!\n"); )
+       errno = EIO; sit(bad_block_delay); return (-1);
+      }
     }
 #ifdef DEBUG
     if (best)