[apparmor] [PATCH 1/3] parser: Send PDEBUG() to stderr

Seth Arnold seth.arnold at canonical.com
Sat Feb 28 00:09:56 UTC 2015


On Fri, Feb 27, 2015 at 05:37:10PM -0600, Tyler Hicks wrote:
> PDEBUG() and PERROR() should both go to stderr.
> 
> Signed-off-by: Tyler Hicks <tyhicks at canonical.com>

Acked-by: Seth Arnold <seth.arnold at canonical.com>

Acked for trunk; I'm not opposed to them for 2.9 but I think someone else
ought to chime in too if we want these in 2.9.

Thanks

> ---
>  parser/parser.h        | 2 +-
>  parser/parser_misc.c   | 2 +-
>  parser/parser_policy.c | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/parser/parser.h b/parser/parser.h
> index da1b93d..8d43bfe 100644
> --- a/parser/parser.h
> +++ b/parser/parser.h
> @@ -172,7 +172,7 @@ extern int preprocess_only;
>  
>  
>  #ifdef DEBUG
> -#define PDEBUG(fmt, args...) printf("parser: " fmt, ## args)
> +#define PDEBUG(fmt, args...) fprintf(stderr, "parser: " fmt, ## args)
>  #else
>  #define PDEBUG(fmt, args...)	/* Do nothing */
>  #endif
> diff --git a/parser/parser_misc.c b/parser/parser_misc.c
> index d0b1f8d..fdd364a 100644
> --- a/parser/parser_misc.c
> +++ b/parser/parser_misc.c
> @@ -43,7 +43,7 @@
>  /* #define DEBUG */
>  #ifdef DEBUG
>  #undef PDEBUG
> -#define PDEBUG(fmt, args...) printf("Lexer: " fmt, ## args)
> +#define PDEBUG(fmt, args...) fprintf(stderr, "Lexer: " fmt, ## args)
>  #else
>  #undef PDEBUG
>  #define PDEBUG(fmt, args...)	/* Do nothing */
> diff --git a/parser/parser_policy.c b/parser/parser_policy.c
> index d941350..c27c790 100644
> --- a/parser/parser_policy.c
> +++ b/parser/parser_policy.c
> @@ -34,7 +34,7 @@
>  
>  /* #define DEBUG */
>  #ifdef DEBUG
> -#define PDEBUG(fmt, args...) printf("Lexer: " fmt, ## args)
> +#define PDEBUG(fmt, args...) fprintf(stderr, "Lexer: " fmt, ## args)
>  #else
>  #define PDEBUG(fmt, args...)	/* Do nothing */
>  #endif
> -- 
> 2.1.4
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20150227/2324180d/attachment-0001.pgp>


More information about the AppArmor mailing list