qemu 0.5.5.s.20040624 does not build on STABLE

Juergen Lock nox at jelal.kn-bremen.de
Fri Jun 25 17:03:08 PDT 2004


On Fri, Jun 25, 2004 at 03:15:25PM +0200, Guido Berhoerster wrote:
> The last update of qemu to version 0.5.5.s.20040624 broke the
> build on STABLE. To be precise, qemu-mkcow does not compile since
> it utilizes the DIOCGMEDIASIZE ioctl which is not impelmented on
> STABLE. Build log is attached.

Yeah, i forgot to add an #ifdef (and an #include).  It was late...
Try this fix, which i've just send-pr'd:

Index: files/patch-bg
===================================================================
RCS file: /home/ncvs/ports/emulators/qemu/files/patch-bg,v
retrieving revision 1.1
diff -u -r1.1 patch-bg
--- files/patch-bg	25 Jun 2004 07:37:31 -0000	1.1
+++ files/patch-bg	25 Jun 2004 16:35:28 -0000
@@ -8,27 +8,30 @@
  #include <stdlib.h>
  #include <stdio.h>
  #include <stdarg.h>
-@@ -36,6 +38,12 @@
+@@ -36,6 +38,13 @@
  #include <sys/stat.h>
  #include <netinet/in.h>
  
 +#ifdef _BSD
 +#include <sys/types.h>
 +#include <sys/ioctl.h>
++#include <sys/queue.h>
 +#include <sys/disk.h>
 +#endif
 +
  #include "cow.h"
  
  #include "bswap.h"
-@@ -56,6 +64,13 @@ int cow_create(int cow_fd, const char *i
+@@ -56,6 +64,15 @@ int cow_create(int cow_fd, const char *i
              perror(image_filename);
              exit(1);
          }
 +#ifdef _BSD
 +        struct stat sb;
 +        if (!fstat(fd,&sb) && (S_IFCHR & sb.st_mode)) {
++#ifdef DIOCGMEDIASIZE
 +            if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&image_sectors))
++#endif
 +                image_sectors = lseek(fd, 0LL, SEEK_END);
 +        } else
 +#endif                      

	Juergen


More information about the freebsd-ports mailing list