> From: Roger Pau Monne <[email protected]>
> Sent: Thursday, April 6, 2023 12:41 PM
> To: [email protected] <[email protected]>
> Cc: Roger Pau Monne <[email protected]>; Konrad Rzeszutek Wilk 
> <[email protected]>; Ross Lagerwall <[email protected]>
> Subject: [PATCH v2] livepatch-tools: remove usage of error.h 
>  
> It's a GNU libc specific header which prevents building on musl for
> example.  Instead use errx() in ERROR() and DIFF_FATAL() macros.
> 
> Signed-off-by: Roger Pau Monné <[email protected]>
> ---
> Cc: Konrad Rzeszutek Wilk <[email protected]>
> Cc: Ross Lagerwall <[email protected]>
> ---
> Changes since v1:
>  - Use errx().
> ---
>  common.h             | 9 ++++++---
>  create-diff-object.c | 1 -
>  lookup.c             | 7 +++++--
>  prelink.c            | 1 -
>  4 files changed, 11 insertions(+), 7 deletions(-)
> 
> diff --git a/common.h b/common.h
> index 9a9da79..bbaa950 100644
> --- a/common.h
> +++ b/common.h
> @@ -1,18 +1,21 @@
>  #ifndef _COMMON_H_
>  #define _COMMON_H_
>  
> -#include <error.h>
> +#include <err.h>
>  
>  extern char *childobj;
>  
>  #define ERROR(format, ...) \
> -       error(1, 0, "ERROR: %s: %s: %d: " format, childobj, __FUNCTION__, 
> __LINE__, ##__VA_ARGS__)
> +({ \
> +       fflush(stdout); \
> +       errx(1, "ERROR: %s: %s: %d: " format "\n", childobj, __FUNCTION__, 
> __LINE__, ##__VA_ARGS__); \
> +})

Did you mean to add "\n" here? Wouldn't that result in a double new
line?

With that removed (can be done during commit),

Reviewed-by: Ross Lagerwall <[email protected]>

Reply via email to