]> xenbits.xensource.com Git - libvirt.git/commitdiff
virnetlink: fix build on non-Linux
authorEric Blake <eblake@redhat.com>
Mon, 5 Jan 2015 22:08:08 +0000 (15:08 -0700)
committerEric Blake <eblake@redhat.com>
Mon, 5 Jan 2015 23:38:25 +0000 (16:38 -0700)
Commit 4dc04d3a added virNetlinkGetErrorCode, but forgot to provide
a fallback, which kills the build on mingw (among others):

  CCLD     libvirt.la
  Cannot export virNetlinkGetErrorCode: symbol not defined
  collect2: error: ld returned 1 exit status

* src/util/virnetlink.c (virNetlinkGetErrorCode): Provide fallback.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/util/virnetlink.c

index 1a2b7a1b0ddfbc9acce7b1ebb5ddea2757130470..d52f66acf595fc7fc216024123ae86081bc3d1f9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2014 Red Hat, Inc.
+ * Copyright (C) 2010-2015 Red Hat, Inc.
  * Copyright (C) 2010-2012 IBM Corporation
  *
  * This library is free software; you can redistribute it and/or
@@ -276,7 +276,9 @@ int virNetlinkCommand(struct nl_msg *nl_msg,
     return ret;
 }
 
-int virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigned int recvbuflen)
+
+int
+virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigned int recvbuflen)
 {
     struct nlmsgerr *err;
     int result = 0;
@@ -314,6 +316,7 @@ int virNetlinkGetErrorCode(struct nlmsghdr *resp, unsigned int recvbuflen)
     return -EINVAL;
 }
 
+
 static void
 virNetlinkEventServerLock(virNetlinkEventSrvPrivatePtr driver)
 {
@@ -872,4 +875,13 @@ int virNetlinkEventRemoveClient(int watch ATTRIBUTE_UNUSED,
     return -1;
 }
 
+
+int
+virNetlinkGetErrorCode(struct nlmsghdr *resp ATTRIBUTE_UNUSED,
+                       unsigned int recvbuflen ATTRIBUTE_UNUSED)
+{
+    virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _(unsupported));
+    return -EINVAL;
+}
+
 #endif /* __linux__ */