From d18476b4ae971507c5e94b4b73c6d55a9a4c6252 Mon Sep 17 00:00:00 2001 From: Christophe Bothamy Date: Fri, 10 Jan 2003 22:59:44 +0000 Subject: [PATCH] - apply [ 661590 ] Fix read_toc() method in *BSD. Patch from Keith Matthew Jones --- bochs/iodev/cdrom.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/bochs/iodev/cdrom.cc b/bochs/iodev/cdrom.cc index 7ac620e6f..42bfdeb9c 100644 --- a/bochs/iodev/cdrom.cc +++ b/bochs/iodev/cdrom.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: cdrom.cc,v 1.55 2002-12-13 15:28:55 bdenney Exp $ +// $Id: cdrom.cc,v 1.56 2003-01-10 22:59:44 cbothamy Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2002 MandrakeSoft S.A. @@ -101,6 +101,8 @@ extern "C" { #include #include #include +// ntohl(x) et al have been moved out of sys/param.h in FreeBSD 5 +#include // XXX #define BX_CD_FRAMESIZE 2048 @@ -468,7 +470,7 @@ cdrom_interface::cdrom_interface(char *dev) void cdrom_interface::init(void) { - BX_DEBUG(("Init $Id: cdrom.cc,v 1.55 2002-12-13 15:28:55 bdenney Exp $")); + BX_DEBUG(("Init $Id: cdrom.cc,v 1.56 2003-01-10 22:59:44 cbothamy Exp $")); BX_INFO(("file = '%s'",path)); } @@ -881,7 +883,7 @@ cdrom_interface::read_toc(uint8* buf, int* length, bx_bool msf, int start_track) t.data_len = sizeof(tocentry); t.data = &tocentry; - if (ioctl (fd, CDIOREADTOCENTRYS, &tocentry) < 0) + if (ioctl (fd, CDIOREADTOCENTRYS, &t) < 0) BX_PANIC(("cdrom: read_toc: READTOCENTRY failed.")); buf[len++] = 0; // Reserved @@ -910,7 +912,7 @@ cdrom_interface::read_toc(uint8* buf, int* length, bx_bool msf, int start_track) t.data_len = sizeof(tocentry); t.data = &tocentry; - if (ioctl (fd, CDIOREADTOCENTRYS, &tocentry) < 0) + if (ioctl (fd, CDIOREADTOCENTRYS, &t) < 0) BX_PANIC(("cdrom: read_toc: READTOCENTRY lead-out failed.")); buf[len++] = 0; // Reserved @@ -1123,9 +1125,8 @@ cdrom_interface::capacity() } #elif defined(__FreeBSD__) { - // Read the TOC to get the data size, since disklabel doesn't appear - // to work, sadly. - // Keith Jones, 16 January 2000 + // Read the TOC to get the size of the data track. + // Keith Jones , 16 January 2000 #define MAX_TRACKS 100