- reverted to before patch.blkdevsize inclusion, because compilation fails on WIN32.

It will be included back when we know which platforms handle the GETBLKSIZE ioctl right
This commit is contained in:
Christophe Bothamy 2002-06-28 21:34:30 +00:00
parent 383ff23866
commit 17fe31ad4d
2 changed files with 3 additions and 18 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: bochs.h,v 1.68 2002-06-28 14:03:47 cbothamy Exp $
// $Id: bochs.h,v 1.69 2002-06-28 21:34:30 cbothamy Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -58,7 +58,6 @@ extern "C" {
#else
# ifndef WIN32
# include <sys/time.h>
# include <sys/mount.h>
# endif
# include <sys/types.h>
# include <sys/stat.h>

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: harddrv.cc,v 1.57 2002-06-26 16:45:27 cbothamy Exp $
// $Id: harddrv.cc,v 1.58 2002-06-28 21:34:30 cbothamy Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -128,7 +128,7 @@ bx_hard_drive_c::~bx_hard_drive_c(void)
bx_hard_drive_c::init(bx_devices_c *d, bx_cmos_c *cmos)
{
BX_HD_THIS devices = d;
BX_DEBUG(("Init $Id: harddrv.cc,v 1.57 2002-06-26 16:45:27 cbothamy Exp $"));
BX_DEBUG(("Init $Id: harddrv.cc,v 1.58 2002-06-28 21:34:30 cbothamy Exp $"));
/* HARD DRIVE 0 */
@ -2829,20 +2829,6 @@ int concat_image_t::open (const char* pathname0)
if (ret) {
BX_PANIC(("fstat() returns error!"));
}
if (S_ISBLK(stat_buf.st_mode))
{
/* it's a block device. st_size will be 0, so set it to the correct size. */
if (ioctl(fd_table[i],BLKGETSIZE,&(stat_buf.st_size))==-1)
BX_PANIC(("size of block device %s can't be read",pathname));
if (stat_buf.st_size > (0x7ffffff/512))
{
BX_ERROR(("size of disk image is too big, rounded down"));
stat_buf.st_size=0x7ffffe00; /* maximum size without overflow */
}
else
stat_buf.st_size*=512; /* returned value is sectors */
/* what about an overflow here? should possibly use fstat64 */
}
if ((stat_buf.st_size % 512) != 0) {
BX_PANIC(("size of disk image must be multiple of 512 bytes"));
}