From 68b97479441dae017501834538ecb11368a9844a Mon Sep 17 00:00:00 2001 From: garbled Date: Wed, 4 Nov 1998 08:27:38 +0000 Subject: Patches to fix PR's: 6270 and 6391. Mainly dealing with cdd's assumption that /dev/rcd0d is the correct raw device. It now handles multiple drives, and guesses the right raw device. Thanks to Rene Hexel for the patch for the multiple devices. --- audio/cdd/patches/patch-ab | 161 +++++++++++++++++++++++++++++++++++++++++++++ audio/cdd/patches/patch-ac | 11 ++++ 2 files changed, 172 insertions(+) create mode 100644 audio/cdd/patches/patch-ab create mode 100644 audio/cdd/patches/patch-ac (limited to 'audio/cdd') diff --git a/audio/cdd/patches/patch-ab b/audio/cdd/patches/patch-ab new file mode 100644 index 00000000000..52170eabfd4 --- /dev/null +++ b/audio/cdd/patches/patch-ab @@ -0,0 +1,161 @@ +$NetBSD: patch-ab,v 1.1 1998/11/04 08:27:38 garbled Exp $ +--- cdd.c.orig Wed Nov 4 01:14:06 1998 ++++ cdd.c Wed Nov 4 01:14:11 1998 +@@ -56,8 +56,10 @@ + #include + #include + #include ++#include + #include + #include ++#include + #include "cdd.h" + #include "cdd_cdcmds.h" + #include "cdd_util.h" +@@ -68,11 +70,13 @@ + OPTS G_opts; + + int F_cdctlfd; ++char cd_raw_partition[11]; + + int main(int argc, char *argv[]) + { + CDTOC cdtoc; + int count; ++char ctldev[MAXPATHLEN]; + + strcpy(G_opts.workdir, "/tmp"); + G_opts.onlyaudio = FALSE; +@@ -83,27 +87,12 @@ + G_opts.bequiet = FALSE; + G_opts.dostdout = FALSE; + G_opts.cddb = FALSE; ++strcpy(G_opts.cddev, "cd0"); + + signal(SIGINT, resetcd); + signal(SIGBUS, resetcd); + signal(SIGSEGV, resetcd); + +-#ifdef __NetBSD__ +-F_cdctlfd=scsi_open("/dev/rcd0d", O_RDWR); +-#else +-F_cdctlfd=scsi_open("/dev/rcd0.ctl", O_RDWR); +-#endif +- +-if(F_cdctlfd < 0) +- { +-#ifdef __NetBSD__ +- fprintf(stderr,"Unable to open /dev/rcd0d [%d]\n", errno); +-#else +- fprintf(stderr,"Unable to open /dev/rcd0.ctl [%d]\n", errno); +-#endif +- exit(0); +- } +- + for(count=1;count][-a][-d][-r][-n][-noed][-h]", argv[0]); + fprintf(stderr,"[-p][-q][destdir|-]\n\n"); + fprintf(stderr," -h This help\n"); ++ fprintf(stderr," -c dev Use CD-ROM drive (default: %s)\n", G_opts.cddev); + fprintf(stderr," -t # Copy only Track #\n"); + fprintf(stderr," -a Copy only AUDIO tracks\n"); + fprintf(stderr," -p Play AUDIO during Copy\n"); +@@ -155,11 +156,27 @@ + fprintf(stderr,"any error checking\n\n"); + fprintf(stderr,"Running CDD with no options will show the table of "); + fprintf(stderr,"contents of the CD in the \ndrive\n\n"); +- close(F_cdctlfd); + exit(0); + } + } + ++#ifdef __NetBSD__ ++if (G_opts.cddev[0] == '/') ++ strcpy(ctldev, G_opts.cddev); ++else ++ sprintf(ctldev, "/dev/r%s%c", G_opts.cddev, getrawpartition() + 'a'); ++#else ++sprintf(ctldev, "/dev/r%s.ctl", G_opts.cddev); ++#endif ++ ++F_cdctlfd=scsi_open(ctldev, O_RDWR); ++ ++if(F_cdctlfd < 0) ++ { ++ fprintf(stderr,"Unable to open %s [%d]\n", ctldev, errno); ++ exit(0); ++ } ++ + cdd_printf("\nCDD v%s, Copyright (C) 1996, ", VERSION); + cdd_printf("Charles R. Henrich, All Rights Reserved.\n\n"); + +@@ -367,7 +384,8 @@ + #ifdef __NetBSD__ + ifd=dup(F_cdctlfd); + #else +-ifd=open("/dev/rcd0c", O_RDONLY, 0600); ++sprintf(buffer, "/dev/r%sc", G_opts.cddev); ++ifd=open(buffer, O_RDONLY, 0600); + #endif + + if(ifd < 0) +@@ -375,7 +393,7 @@ + #ifdef __NetBSD__ + fprintf(stderr,"Unable to dup descriptor\n"); + #else +- fprintf(stderr,"Unable to open /dev/rcd0c\n"); ++ fprintf(stderr,"Unable to open %s\n", buffer); + #endif + close(F_cdctlfd); + exit(0); +@@ -435,7 +453,8 @@ + #ifdef __NetBSD__ + ifd=dup(F_cdctlfd); + #else +-ifd=open("/dev/rcd0c", O_RDONLY); ++sprintf(buffer, "/dev/r%sc", G_opts.cddev); ++ifd=open(buffer, O_RDONLY); + #endif + + if(ifd < 0) +@@ -443,7 +462,7 @@ + #ifdef __NetBSD__ + fprintf(stderr,"Unable to dup descriptor\n"); + #else +- fprintf(stderr,"Unable to open /dev/rcd0c\n"); ++ fprintf(stderr,"Unable to open %s\n", buffer); + #endif + close(F_cdctlfd); + exit(0); diff --git a/audio/cdd/patches/patch-ac b/audio/cdd/patches/patch-ac new file mode 100644 index 00000000000..a3e8f2dfb4d --- /dev/null +++ b/audio/cdd/patches/patch-ac @@ -0,0 +1,11 @@ +$NetBSD: patch-ac,v 1.1 1998/11/04 08:27:38 garbled Exp $ +--- cdd.h.orig Mon Jul 14 02:56:31 1997 ++++ cdd.h Sun Nov 1 19:18:58 1998 +@@ -85,6 +85,7 @@ + int bequiet; + int dostdout; + int cddb; ++ char cddev[MAXPATHLEN]; + } OPTS; + + typedef struct tocentry -- cgit v1.2.3