[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2] livepatch-tools: remove usage of error.h
- To: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Fri, 21 Apr 2023 09:23:37 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OYpo+T+lEWFbN5SsXB//zMqCdlVvf6dsQVb8KerY+q0=; b=jnQBPs91UHzwusOeQLVB36ca2ZX8VzHZCvxIe52eWT3TQHBMHHZXfri7SQLqPQz67VD3YxCUrETluCs3G1FTZ6TMWYXdEaoi7PrtFKcjzinFtbmbAP/HMhVEyA8CGH6/W8mfuzcTMCym5T0UawNYcIEFUP/VgZ8gXXrgboiH4dF0C9+ixvioXaIcl0aa5P6GbmkaN30BHJ2AWzQN7+LCgfA+MdzRCiJ8OKDMmDjWgaBF1D2uuMFljkfghViImFwWe6UmwsbFYay1XdPKpG49xLXh92GcuA44YotJYhy+8lGPugzcNoEnUad5Jb+gAawcjNXlAALJ31puNrI3GR4lyw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U41SZ815dtlfwm3UrFmkIz+fmza5hra7YaWV4u+wNl2xnqyRRfYCuWZ4WHTgMDfZGTjkvPjHEGz1nw5S+0BL2piRNk2rA2u95HOGrg6Ul8e32hz0993UxZyJ7jWEymoRj074NreFIzegU/lsL7auESc78Cv3ySY/ZAwUMBTLH4g630mNFJZmXnyamGJ/pFNC2RZUHTC2Z8ATZQBTNsswy2D+D7mLncFG/1+wyD34uKskejv/tMPYPA6KNlU6/85KCQRKYJeL2Yti2lkzwxKl9fQi6N/7ezPfmzmAe+i48Vs4u8Mc2TBfO1Fd1Oi22b/KkqHtuuqcRg/WXv6KcoIzJg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
- Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
- Delivery-date: Fri, 21 Apr 2023 07:24:05 +0000
- Ironport-data: A9a23:xuvtYK93uFRLTw8PIqipDrUDnn+TJUtcMsCJ2f8bNWPcYEJGY0x3m 2UWXj/QPvqIYjakKNkjbNy//ElQ7MLUmNRmT1E6/Cs8E34SpcT7XtnIdU2Y0wF+jCHgZBk+s 5hBMImowOQcFCK0SsKFa+C5xZVE/fjUAOG6UKicYXoZqTZMEE8JkQhkl/MynrlmiN24BxLlk d7pqojUNUTNNwRcawr40Ire7kI+1BjOkGlA5AdmOaoS5Aa2e0Q9V/rzG4ngdxMUfaEMdgKKb 76r5K20+Grf4yAsBruN+losWhRXKlJ6FVHmZkt+A8BOsDAbzsAB+v9T2M4nQVVWk120c+VZk 72hg3ASpTABZcUgkMxFO/VR/roX0aduoNcrKlDn2SCfItGvn9IBDJyCAWlvVbD09NqbDklqy 9AedHMGUSvElv60yZbjQOhlmv4aeZyD0IM34hmMzBn/JNN/G9XmfP+P4tVVmjAtmspJAPDSI dIDbiZiZwjBZBsJPUoLDJU5n6GjgXyXnz9w8QrJ4/ZopTaNilAuuFTuGIO9ltiiX8Jak1zev mvb12/4HgsbJJqUzj/tHneE37eRwn2jAthJfFG+3u4t3XyhyW06MxopdGG3uOD+plOUWc0Kf iT4/QJr98De7neDXtT7GhG1vnOAlhodQMZLVf037hmXzajZ6BrfAXILJhZCb9o8vcNwWj0u1 XeOhdriATEpu7qQIU9x7Z+RpDK2fC0Kd2kLYHZeSRNfu4W85oYukhjIU9BvVravicH4Ei3xx DbMqzUig7IUjogA0KDTEU37vg9Ab6PhFmYdjjg7lEr8hu+lTOZJv7CV1GU=
- Ironport-hdrordr: A9a23:h5w5oKi0xTVofIPLD49gAV5Em3BQXh4ji2hC6mlwRA09TyX5ra 2TdZUgpHrJYVMqMk3I9uruBEDtex3hHP1OkOss1NWZPDUO0VHARO1fBOPZqAEIcBeOldK1u5 0AT0B/YueAd2STj6zBkXSF+wBL+qj6zEiq792usEuEVWtRGsVdB58SMHfiLqVxLjM2YqYRJd 6nyedsgSGvQngTZtTTPAh/YwCSz+e78q4PeHQ9dmca1DU=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Thu, Apr 20, 2023 at 04:14:55PM +0000, Ross Lagerwall wrote:
> > From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
> > Sent: Thursday, April 6, 2023 12:41 PM
> > To: xen-devel@xxxxxxxxxxxxxxxxxxxx <xen-devel@xxxxxxxxxxxxxxxxxxxx>
> > Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>; Konrad Rzeszutek Wilk
> > <konrad.wilk@xxxxxxxxxx>; Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
> > 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é <roger.pau@xxxxxxxxxx>
> > ---
> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
> > Cc: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
> > ---
> > 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 <ross.lagerwall@xxxxxxxxxx>
Thanks, please adjust at commit. This is a leftover from v1
when I wasn't using errx.
Roger.
|