--- old/cdda2wav0.8/Makefile	Fri Feb 28 21:02:57 1997
+++ cdda2wav0.8/Makefile	Wed Nov  5 06:11:38 1997
@@ -7,7 +7,7 @@
 
 RM=rm -f
 #CC=c89
-CC=gcc
+CC=gcc -D_GNU_SOURCE
 
 # If you get compile errors and you have
 # incorrect/missing links from /usr/include to the
@@ -41,22 +41,22 @@
 # uncomment one INTERFACE and one DEF_DEVICE line
 # (for details consult the README)
 
-INTERFACE=\"generic_scsi\"
+#INTERFACE=\"generic_scsi\"
 
 				# set the default cdrom device
-DEF_DEVICE=\"/dev/sgd\"
+#DEF_DEVICE=\"/dev/sgd\"
 				# matching device
                                 # used for a MULTISESSION ioctl
-AUX_DEVICE=\"/dev/cdrom\"
+#AUX_DEVICE=\"/dev/cdrom\"
 
 # for nonscsi cdrom drives with cdda kernel support ie atapi, cdu31a
 # choose this if the kernel driver supports cdda reading
-#INTERFACE=\"cooked_ioctl\"
+INTERFACE=\"cooked_ioctl\"
 
 				# set the default cdrom device
-#DEF_DEVICE=\"/dev/cdrom\"
+DEF_DEVICE=\"/dev/cdrom\"
 				# not actually used
-#AUX_DEVICE=\"/dev/cdrom\"
+AUX_DEVICE=\"/dev/cdrom\"
 
 
 ############# Sound support
@@ -88,8 +88,8 @@
 DEF_FILE=\"audio\"
 
 ############## installation directories #####################################
-MAN_DIRECTORY=/usr/local/man
-BIN_DIR=/usr/local/bin
+MAN_DIRECTORY=/usr/man
+BIN_DIR=/usr/bin
 ROOT=root
 
 ############## enable/disable info files ####################################
--- old/cdda2wav0.8/cdda2wav.c	Fri Feb 28 22:39:06 1997
+++ cdda2wav0.8/cdda2wav.c	Thu Nov  6 13:11:17 1997
@@ -907,6 +907,7 @@
   }
   /*********************** fork **************************************/
   if (child_pid == 0) {
+    int success;
     /* child READER section */
 
     while (1) {
@@ -932,7 +933,7 @@
 fprintf(stderr,"reading %02ld from sec %6ld to %6ld...\t i=%ld\n",
        SectorBurst, lSector, lSector+SectorBurst-1, i);
 #endif
-      ReadCdRom( p, lSector, SectorBurst );
+      success = ReadCdRom( p, lSector, SectorBurst );
 
       /* Set buffer state to free */
       semrelease(sem_id,swap ^ 2);
@@ -942,7 +943,7 @@
       if (i <= overlap * CD_FRAMESAMPLES)
 	i += CD_FRAMESAMPLES;
 
-      if (i < 1) {
+      if (i < 1 || !success) {
 	  swap = (++swap & 1);
 	  semrelease(sem_id,swap ^ 2);
 
--- old/cdda2wav0.8/interface.c	Sun Feb 23 13:28:02 1997
+++ cdda2wav0.8/interface.c	Thu Nov  6 13:11:12 1997
@@ -572,7 +572,7 @@
 
 /* Read max. SectorBurst of cdda sectors to bufferCdda+OFF
    via standard SCSI-2 Read(10) command */
-static void ReadStandard (unsigned char *p, long lSector, unsigned long SectorBurstVal )
+static int ReadStandard (unsigned char *p, long lSector, unsigned long SectorBurstVal )
 {
   /* READ10, flags, block1 msb, block2, block3, block4 lsb, reserved, 
      transfer len msb, transfer len lsb, block addressing mode */
@@ -595,12 +595,13 @@
     ;
   if (!count)
     FatalError ("Read CD-ROM10 failed\n");
+  return 1;
 }
 
 
 /* Read max. SectorBurst of cdda sectors to bufferCdda+OFF
    via vendor-specific ReadCdda(10) command */
-static void ReadCdda10 (unsigned char *p, long lSector, unsigned long SectorBurstVal )
+static int ReadCdda10 (unsigned char *p, long lSector, unsigned long SectorBurstVal )
 {
   /* READ10, flags, block1 msb, block2, block3, block4 lsb, reserved, 
      transfer len msb, transfer len lsb, block addressing mode */
@@ -623,11 +624,12 @@
     ;
   if (!count)
     FatalError ("Read CD-ROM10 (NEC) failed\n");
+  return 1;
 }
 
 /* Read max. SectorBurst of cdda sectors to bufferCdda+OFF
    via vendor-specific ReadCdda(12) command */
-static void ReadCdda12 (unsigned char *p, long lSector, unsigned long SectorBurstVal )
+static int ReadCdda12 (unsigned char *p, long lSector, unsigned long SectorBurstVal )
 {
   static unsigned char cmdblk [12] = {0xd8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 
@@ -647,6 +649,7 @@
     ;
   if (!count)
     FatalError ("Read CD-ROM12 failed\n");
+  return 1;
 }
 
 /* Read the Sub-Q-Channel to SubQbuffer+OFF */
@@ -875,7 +878,7 @@
 /* read 'SectorBurst' adjacent sectors of audio sectors 
  * to Buffer '*p' beginning at sector 'lSector'
  */
-static void ReadCdRom_cooked (unsigned char *p, long lSector, unsigned long SectorBurstVal )
+static int ReadCdRom_cooked (unsigned char *p, long lSector, unsigned long SectorBurstVal )
 {
   int retry_count=0;
 
@@ -895,15 +898,16 @@
 	  if (errno == EINVAL || errno == EIO)
 	      fprintf( stderr, "Sorry, this driver and/or drive does not support cdda reading.\n");
 	  perror("cooked: Read cdda ");
-	  exit( err );
+	  return 0;
       } else {
 	  fprintf(stderr, "can't read frame #%d (error %d).\n", 
 		  arg.addr.lba, err);
-	  exit( -1 );
+	  return 0;
       }
   }
   if (!quiet && retry_count != 1)
-    fprintf(stderr, "\n%d retries\n",retry_count-1);
+    fprintf(stderr, " %d retries\n",retry_count-1);
+  return 1;
 }
 
 /* request sub-q-channel information. This function may cause confusion
--- old/cdda2wav0.8/interface.h	Sun Feb 16 19:09:10 1997
+++ cdda2wav0.8/interface.h	Thu Nov  6 13:07:13 1997
@@ -100,7 +100,7 @@
 /* cdrom access function pointer */
 void     (*EnableCdda) (int Switch);
 unsigned (*ReadToc) ( TOC *ptoc );
-void     (*ReadCdRom) (unsigned char *p, long lSector, unsigned long SectorBurstVal );
+int      (*ReadCdRom) (unsigned char *p, long lSector, unsigned long SectorBurstVal );
 subq_chnl *(*ReadSubQ) ( unsigned char format, unsigned char track );
 void Read_Subinfo(unsigned int pos, unsigned int length);
 void dump_extra_info(void);
--- old/cdda2wav0.8/uti.h	Fri Feb 14 22:35:49 1997
+++ cdda2wav0.8/uti.h	Wed Nov  5 06:12:41 1997
@@ -11,6 +11,8 @@
  *
  *****************************************************************************/
 
+#include <sys/types.h>
+
 #ifndef TRUE
 #define TRUE 1
 #define FALSE 0
