]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: virpcimock: Always declare __open_2
authorPeter Krempa <pkrempa@redhat.com>
Fri, 16 Aug 2019 07:41:14 +0000 (09:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 16 Aug 2019 08:00:16 +0000 (10:00 +0200)
In some cases e.g. with clang on fedora 30 __open2 isn't even declared
which results in the following build error:

/home/pipo/libvirt/tests/virpcimock.c:939:1: error: no previous prototype for function
      '__open_2' [-Werror,-Wmissing-prototypes]
__open_2(const char *path, int flags)

Add a separate declaration to appease the compiler.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
tests/virpcimock.c

index 829d61cd3f7e124b39a20e10b4abe63c9a78b083..cfe91ba3ff367546746426b6a7e396832af76ff7 100644 (file)
@@ -935,6 +935,11 @@ open(const char *path, int flags, ...)
 }
 
 
+/* in some cases this function may not be present in headers, so we need
+ * a declaration to silence the complier */
+int
+__open_2(const char *path, int flags);
+
 int
 __open_2(const char *path, int flags)
 {