/[qemu]/qemu/block.c
ViewVC logotype

Diff of /qemu/block.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.19 by bellard, Tue Apr 26 21:59:26 2005 UTC revision 1.20 by bellard, Wed Apr 27 19:55:01 2005 UTC
# Line 548  static int raw_open(BlockDriverState *bs Line 548  static int raw_open(BlockDriverState *bs
548      BDRVRawState *s = bs->opaque;      BDRVRawState *s = bs->opaque;
549      int fd;      int fd;
550      int64_t size;      int64_t size;
551    #ifdef _BSD
552        struct stat sb;
553    #endif
554    
555      fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);      fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE);
556      if (fd < 0) {      if (fd < 0) {
# Line 557  static int raw_open(BlockDriverState *bs Line 560  static int raw_open(BlockDriverState *bs
560          bs->read_only = 1;          bs->read_only = 1;
561      }      }
562  #ifdef _BSD  #ifdef _BSD
563      {      if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) {
         struct stat sb;  
         if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) {  
564  #ifdef DIOCGMEDIASIZE  #ifdef DIOCGMEDIASIZE
565              if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size))          if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size))
566  #endif  #endif
567                  size = lseek(fd, 0LL, SEEK_END);              size = lseek(fd, 0LL, SEEK_END);
568      } else      } else
569  #endif  #endif
570      {      {

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26