Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / net / aoe-vblade / patches / patch-aa
blob887f111133064977e212a13ff79ceb289845cb52
1 $NetBSD: patch-aa,v 1.2 2007/03/31 13:36:27 obache Exp $
3 --- freebsd.c.orig      2006-11-13 18:57:34.000000000 +0000
4 +++ freebsd.c
5 @@ -14,7 +14,12 @@
6  #include <sys/time.h>
7  
8  #include <netinet/in.h>
9 +#ifdef __NetBSD__
10 +#include <net/if.h>
11 +#include <net/if_ether.h>
12 +#else
13  #include <net/ethernet.h>
14 +#endif
15  #include <net/bpf.h>
16  #include <net/if.h>
17  #include <net/if_arp.h>
18 @@ -26,7 +31,13 @@
19  #include <net/if.h>
20  #include <sys/stat.h>
21  #include <sys/disklabel.h>
22 +#ifdef __DragonFly__
23 +#include <sys/disklabel32.h>
24 +#endif
25  #include <sys/select.h>
26 +#ifdef __NetBSD__
27 +#include <sys/param.h>
28 +#endif
29  #include <sys/sysctl.h>
31  #include <fcntl.h>
32 @@ -302,10 +313,18 @@ getsize(int fd)
33         vlong size;
34         struct stat s;
35         int n;
36 +#ifdef __DragonFly__
37 +       struct disklabel32 lab;
38 +#else
39         struct disklabel lab;
40 +#endif
42         // Try getting disklabel from block dev
43 +#ifdef __DragonFly__
44 +       if ((n = ioctl(fd, DIOCGDINFO32, lab)) != -1) {  
45 +#else
46         if ((n = ioctl(fd, DIOCGDINFO, lab)) != -1) {  
47 +#endif
48                 size = lab.d_secsize * lab.d_secperunit;
49         } else {
50                 // must not be a block special dev