]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virInitctlRequest: Don't hardcode 384 bytes size
authorGuido Günther <agx@sigxcpu.org>
Wed, 1 May 2013 20:35:44 +0000 (22:35 +0200)
committerGuido Günther <agx@sigxcpu.org>
Thu, 2 May 2013 06:18:42 +0000 (08:18 +0200)
When MAXHOSTNAMELEN is set we have to take it's value into account.
Otherwise the build fails on kFreeBSD (FreeBSD kernel and GNU userland)

src/util/virinitctl.c

index 1618ffa978e0b5a85cad63249f83fc4746bd20e2..9a3e8a35516a4055da8a7583f3d014670dfaf53f 100644 (file)
@@ -103,7 +103,11 @@ struct virInitctlRequest {
     } i;
 };
 
-verify(sizeof(struct virInitctlRequest) == 384);
+# ifdef MAXHOSTNAMELEN
+  verify(sizeof(struct virInitctlRequest) == 320 + MAXHOSTNAMELEN);
+# else
+  verify(sizeof(struct virInitctlRequest) == 384);
+#endif
 
 /*
  * Send a message to init to change the runlevel