[libvirt] [PATCH] logging.c: Properly indent and ignore one syntax-check rule

Jiri Denemark jdenemar at redhat.com
Fri Nov 2 10:35:04 UTC 2012


On Fri, Nov 02, 2012 at 11:22:05 +0100, Michal Privoznik wrote:
> With our fix of mkostemp (pushed as 2b435c15) we define a macro
> to compile with uclibc. However, this definition is conditional
> and thus needs to be properly indented. Moreover, with this definition
> sc_prohibit_mkstemp syntax-check rule keeps yelling:
> 
>   src/util/logging.c:63:# define mkostemp(x,y) mkstemp(x)
>   maint.mk: use mkostemp with O_CLOEXEC instead of mkstemp
> 
> Therefore we should ignore this file for this rule.
> ---
> 
> Pushed under build-breaker rule.
> 
>  cfg.mk             |    2 ++
>  src/util/logging.c |    2 +-
>  2 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/cfg.mk b/cfg.mk
> index cda04e4..963f642 100644
> --- a/cfg.mk
> +++ b/cfg.mk
> @@ -817,3 +817,5 @@ exclude_file_name_regexp--sc_unmarked_diagnostics = \
>    ^(docs/apibuild.py|tests/virt-aa-helper-test)$$
>  
>  exclude_file_name_regexp--sc_size_of_brackets = cfg.mk
> +
> +exclude_file_name_regexp--sc_prohibit_mkstemp = ^src/util/logging\.c$$
> diff --git a/src/util/logging.c b/src/util/logging.c
> index c0b2f0b..27bd74c 100644
> --- a/src/util/logging.c
> +++ b/src/util/logging.c
> @@ -60,7 +60,7 @@
>  
>  #ifdef __UCLIBC__
>  /* uclibc does not implement mkostemp GNU extention */
> -#define mkostemp(x,y) mkstemp(x)
> +# define mkostemp(x,y) mkstemp(x)
>  #endif
>  
>  VIR_ENUM_DECL(virLogSource)

The fix is actually very wrong and should be completely reverted. The right
fix is to remove the whole #ifdef __UCLIBC__ part which should have never been
there.

Jirka




More information about the libvir-list mailing list