ref: 517fa8b08d106c800f01c4f042d2b68d7036abd2
parent: 7467476e5a7233cea3b639d8ae31a6882b4a7e7e
author: Håkan Hjort <[email protected]>
date: Fri Jul 12 19:28:42 EDT 2002
Include config.h before testing defines in the BSDi ioctl code. Add a bug fix
--- a/configure.in
+++ b/configure.in
@@ -103,7 +103,6 @@
dnl
dnl BSDI: dvd.h
dnl
- NEED_BSDI_LIBDVD=0
AC_EGREP_HEADER(dvd_struct,dvd.h,[
AC_DEFINE(DVD_STRUCT_IN_DVD_H, 1,
Define if <dvd.h> defines DVD_STRUCT.)
@@ -114,10 +113,8 @@
dnl BSDI: /sys/dev/scsi/scsi_ioctl.h, using our own libdvd
dnl
AC_CHECK_HEADERS(/sys/dev/scsi/scsi_ioctl.h,[
- NEED_BSDI_LIBDVD=1
AC_DEFINE(DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H, 1,
Define if <extras/BSDI_dvdioctl/dvd.h> defines DVD_STRUCT.)
- EXTRA_SRC="${EXTRA_SRC} bsdi_ioctl.c"
LINUX_DVD_STRUCT=1
])
])
@@ -163,7 +160,6 @@
CFLAGS="-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DDVDCSS_DIST $CFLAGS"
-AC_SUBST(EXTRA_SRC)
AC_SUBST(EXTRA_LIB)
AC_OUTPUT([Makefile src/Makefile src/dvdcss/Makefile test/Makefile debian/Makefile])
--- a/src/bsdi_ioctl.c
+++ b/src/bsdi_ioctl.c
@@ -1,5 +1,7 @@
-#ifdef NEED_BSDI_LIBDVD
+#include "config.h"
+#ifdef DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H
+
/*
* Hacked version of the linux cdrom.c kernel module - everything except the
* DVD handling ripped out and the rest rewritten to use raw SCSI commands
@@ -43,7 +45,7 @@
int buflen;
int rw;
int timeout;
- struct scsi_user_cdb *sus;
+ scsi_user_sense_t *sus;
} cgc_t;
static int scsi_cmd(int, cgc_t *);
@@ -435,7 +437,7 @@
cp[12], cp[13], cp[14], cp[15]);
}
if (cgc->sus)
- bcopy(&suc, cgc->sus, sizeof (struct scsi_user_cdb));
+ bcopy(&suc.suc_sus, cgc->sus, sizeof (struct scsi_user_sense));
if (scsistatus)
return(EIO); /* generic i/o error for unsuccessful status */
return(0);