[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] livepatch-tools: remove usage of error.h


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Thu, 20 Apr 2023 16:14:55 +0000
  • Accept-language: en-US
  • 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=5qYw18nuoylvmGWA8A6EOst6p1DtVudzE1QBsL1wGH8=; b=ZoBt7tCildVaKnke2inakBiB7CVNBS7l6GL4LWhhQvAogrGvcAPzWbWB3Zdvkx8z0f4SJxF9U3vKCjddKi7xz52tWrUY96SKyE44+YsZH3eLmw21kBUU/MHZCotNFR7vD8SlnjkzlLRaONe0JMnkoGjM0Wbk9c5CxJ2WGgVvdsq8JFTWrMj2ZBUtzCzaEyrmqwkEKUQgZaaKEA4R7CoMhp9dPDdCzrb+qpd1bY6VEBJEaZPEuch2GhcANsGiAi2ip3dhnK+mwrMXnN4j/isDSfyyLxdBpCHwTLWhpr0OpwbGQjsehKFbs9MYB/4fji1VAQX+5nW/QHonzvyGrD9GwA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CjpzLjh2DlQQl+TspiHwKVVl5R/i7owrGn97wrSak2wbj9jC5IhGk6/cWepv3RJQdyLKkRnmOaHtWdoKBfDEKNKLlWQ8E3+QqICCM4UkpLNCYdpbHqnQK2TLidOGyJTWzsiq9AsjKq2nkO34AIDs/lnLqNFnLMjmWkf40zTCjaXBSKPOQIMIt+y5CO5fbzjc+Oz1yq+B80cgy6rge3GwlJ6AsugsWV97jPSGIK9WG7eAlVWlLrQpMHv4GKdxVsbmc6dXK45UKt11BEvh09mymJT+NzBi1hPe4qy3Aw10ZHSHrxhYZ1aHGAucA+8xw989SMP+yn0kQ2+09y6sUXZvCg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
  • Delivery-date: Thu, 20 Apr 2023 16:15:53 +0000
  • Ironport-data: A9a23:hbWLT6rxK0V2P/A7xO5krmcLwgleBmI/ZBIvgKrLsJaIsI4StFCzt garIBmPO/yPNDb9c99zaIqwoBgDvMOBzdFgQQc5+Sw1QyxDpJuZCYyVIHmrMnLJJKUvbq7FA +Y2MYCccZ9uHhcwgj/3b9ANeFEljfngqoLUUbKCYWYpA1c/Ek/NsDo788YhmIlknNOlNA2Ev NL2sqX3NUSsnjV5KQr40YrawP9UlKm06WJwUmAWP6gR5weCzSFNUPrzGInqR5fGatgMdgKFb 76rIIGRpgvx4xorA9W5pbf3GmVirmn6ZFXmZtJ+AsBOszAazsAA+v9T2Mk0MC+7vw6hjdFpo OihgLTrIesf0g8gr8xGO/VQO3kW0aSrY9YrK1Dn2SCY5xWun3cBX5yCpaz5VGEV0r8fPI1Ay RAXAG4BdFO+u/K2+bO6ZK5pgJ8DdsTxYKpK7xmMzRmBZRonabbqZvyToPV+jHI3jM0IGuvCb c0EbzYpdA7HfxBEJlYQDtQ5gfusgX78NTZfrTp5p4JuuzSVkFM3jeiraYSEEjCJbZw9ckKwv GXd5CL9Cx4XLsOWzT6t+XOwnO7f2yj8Xer+EZXhrqAx2A3Injx75Bs+e2a9jeW72hWCRNdcC nEF/BVypqtp3Rn+JjX6d1jiyJKehTYMVtwVH+Ak5QWlzqvP/x3fFmUCViRGatEtqIkxXzNC/ lyOmcngCXpwsbmWYXWH/7yQoHW5Pi19EIMZTSoNTA9A6d+zpog210vLVow6Tv/zicDpEzbtx TzMtDI5m7gYkc8M0eO84EzDhDWv4JPOS2bZ+znqY45s1SshDKbNWmBiwQOFhRqcBO51lmW8g UU=
  • Ironport-hdrordr: A9a23:MbtWUa67x+r5N42g1wPXwOrXdLJyesId70hD6qkRc20xTiX8ra rCoB1173PJYVoqN03I4OrwX5VoIkmsl6Kdg7NwAV7KZmCPhILPFu9fBODZsl7d8kPFl9K14p 0QF5SWWOeaMbGjt7eB3OBjKadZ/DBbytHPuQ4D9QYXcei1UdAc0+8XYjzra3FLeA==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Msip_labels:
  • Thread-index: AQHZaHyz8c+PPcqCtEm6H34gcW31tK80dMV2
  • Thread-topic: [PATCH v2] livepatch-tools: remove usage of error.h

> 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>


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.