[PATCH] Fix syntax-check 'always true header test' for virvsock.c

Daniel Henrique Barboza posted 1 patch 4 years, 10 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20200120183213.1716459-1-danielhb413@gmail.com
src/util/virvsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] Fix syntax-check 'always true header test' for virvsock.c
Posted by Daniel Henrique Barboza 4 years, 10 months ago
Commit 05a38d4c4a ("src: conditionalize / remove use of
sys/ioctl.h") aimed to remove imports of ioctl.h and
conditionalize them for compilation on Windows. However, the
change made in virvsock.c:

-#include <sys/ioctl.h>
+#ifdef HAVE_SYS_IOCTL_H
+# include <sys/ioctl.h>
+#endif

Makes the 'sc_prohibit_always_true_header_tests' rule complain about
the redundancy of this test when building it on Linux.

../src/util/virvsock.c:20:#ifdef HAVE_SYS_IOCTL_H
build-aux/syntax-check.mk: do not test the above HAVE_<header>_H symbol(s);
  with the corresponding gnulib module, they are always true
make: *** [../build-aux/syntax-check.mk:1679: sc_prohibit_always_true_header_tests] Error 1
make: *** Waiting for unfinished jobs....

This patch fixes it by changing the conditional to #ifndef WIN32
instead, like the other changes made by that patch.

CC: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 src/util/virvsock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virvsock.c b/src/util/virvsock.c
index 2638c5095a..1e2eb553d2 100644
--- a/src/util/virvsock.c
+++ b/src/util/virvsock.c
@@ -17,7 +17,7 @@
 
 #include <config.h>
 
-#ifdef HAVE_SYS_IOCTL_H
+#ifndef WIN32
 # include <sys/ioctl.h>
 #endif
 
-- 
2.24.1


Re: [PATCH] Fix syntax-check 'always true header test' for virvsock.c
Posted by Daniel Henrique Barboza 4 years, 10 months ago
Please disregard this patch. This was a problem with my gnulib directory
having leftovers.

Daniel and Laine helped me in the IRC and everything is happy again.


Thanks,


DHB

On 1/20/20 3:32 PM, Daniel Henrique Barboza wrote:
> Commit 05a38d4c4a ("src: conditionalize / remove use of
> sys/ioctl.h") aimed to remove imports of ioctl.h and
> conditionalize them for compilation on Windows. However, the
> change made in virvsock.c:
> 
> -#include <sys/ioctl.h>
> +#ifdef HAVE_SYS_IOCTL_H
> +# include <sys/ioctl.h>
> +#endif
> 
> Makes the 'sc_prohibit_always_true_header_tests' rule complain about
> the redundancy of this test when building it on Linux.
> 
> ../src/util/virvsock.c:20:#ifdef HAVE_SYS_IOCTL_H
> build-aux/syntax-check.mk: do not test the above HAVE_<header>_H symbol(s);
>    with the corresponding gnulib module, they are always true
> make: *** [../build-aux/syntax-check.mk:1679: sc_prohibit_always_true_header_tests] Error 1
> make: *** Waiting for unfinished jobs....
> 
> This patch fixes it by changing the conditional to #ifndef WIN32
> instead, like the other changes made by that patch.
> 
> CC: Daniel P. Berrangé <berrange@redhat.com>
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> ---
>   src/util/virvsock.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/util/virvsock.c b/src/util/virvsock.c
> index 2638c5095a..1e2eb553d2 100644
> --- a/src/util/virvsock.c
> +++ b/src/util/virvsock.c
> @@ -17,7 +17,7 @@
>   
>   #include <config.h>
>   
> -#ifdef HAVE_SYS_IOCTL_H
> +#ifndef WIN32
>   # include <sys/ioctl.h>
>   #endif
>   
>