提交 e5484d33 编写于 作者: B bellard

BSD fix


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1413 c046a42c-6fe2-441c-8c8c-71466251a162
上级 7674e7bf
......@@ -548,6 +548,9 @@ static int raw_open(BlockDriverState *bs, const char *filename)
BDRVRawState *s = bs->opaque;
int fd;
int64_t size;
#ifdef _BSD
struct stat sb;
#endif
fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
if (fd < 0) {
......@@ -557,8 +560,6 @@ static int raw_open(BlockDriverState *bs, const char *filename)
bs->read_only = 1;
}
#ifdef _BSD
{
struct stat sb;
if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) {
#ifdef DIOCGMEDIASIZE
if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册