[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 19/24] errno may not be a gobal R/W variable, use a local variable instead (fix build on NetBSD)
- To: Manuel Bouyer <bouyer@xxxxxxxxxx>
- From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
- Date: Tue, 29 Dec 2020 15:38:53 +0100
- 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-SenderADCheck; bh=brc3dBMjzeYf2pITdRlp4aYD72Io64fv2Yz3H0YC2dQ=; b=lj3y+w+EzzjncSvPrAGNC0W99aHx1uATWgLDYhcH9g40pF8/2nhShiSHziWJj490/o/tmfoDQJFQGu0Ouf3BKzANx0ssa98/oDMTQOMzrfIsrib3bFj6YwCtwkKNc6cgMcwv641ReXxiLkkMNTE+FkSWEA6HXzWdIyi4fmIH/KkQDu2XlgXI5IsOW4UAB3wdWKcVgyp7MtHTsNgrrq633ZNWQmKAKQzoaW6CyvfnzlLDCnDp6lOMO+JUD/4qqlrA6qct6ccpkEIEkr5q6Xb7XD1xTJBc8Sm1nPUnjabQRQvItDf+FGl0JzD3frZssn7Gk8NxtOFUErgO5+kuRkALVw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SJiWc/ipKCpVzoeNK2NYBOLWUAOc6GkLlFDzyxuC9Qep7HcWuVFwI/0YV/LYTThNH8TEZEzUoKxUnjzoiRxTYIWqMxKwhA/7Itage1mU+YIxbKq+J3uIbakAGpst87IRwDYtqRo7nYEZKsLTAXuwj3SyxCrxDv7KTIf+hFGCqzOJHNkNM4FoR6OyTHnKLkMdjyiAdKlKqHgGvghSx7i9UZpWYtrMnxAJvWdWKYBwxI67e0/sTGCEZDik3u4SQYgDuaw2syIV9rMPo/ozeOcBJm0EMjBjFWhCaBxXF/znAAz4jCh/74TOgIUwR+N/dGtDbntFXgVSfraE6XSsM0yNeg==
- Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Tue, 29 Dec 2020 14:39:09 +0000
- Ironport-sdr: VKXMCre+LlgVv0A37TuQSpkqWPSNxPFPrn3oVYNaIM6YshKhdvUiWcAnouao2/1tX2gjcz8OT/ CyPno8ubjrRzat7c4VWoYaxu+jkrSiPIYWkPsh+UJYf7fyiuGMaKXQ/FI3/YdALNyWOugdHM0Y lKdikBDBqiu2oYEAUK/8YsI/70y+OWeTAduLN/2WDzRs3RQFpFZnhp7FvWDDTTQWcOwD2QiRzX GZ4WUYuCUF3LDXUk/ZB6WqgUpmwp3H/4n6xSyRowQBKVZoIQah3zCrYotnY+pUGcjEXi0+5AGL Mdw=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Mon, Dec 14, 2020 at 05:36:18PM +0100, Manuel Bouyer wrote:
> ---
> tools/xenpaging/xenpaging.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/xenpaging/xenpaging.c b/tools/xenpaging/xenpaging.c
> index 33098046c2..39c8c83b4b 100644
> --- a/tools/xenpaging/xenpaging.c
> +++ b/tools/xenpaging/xenpaging.c
> @@ -180,10 +180,11 @@ static int xenpaging_get_tot_pages(struct xenpaging
> *paging)
> static void *init_page(void)
> {
> void *buffer;
> + int rc;
>
> /* Allocated page memory */
> - errno = posix_memalign(&buffer, XC_PAGE_SIZE, XC_PAGE_SIZE);
> - if ( errno != 0 )
> + rc = posix_memalign(&buffer, XC_PAGE_SIZE, XC_PAGE_SIZE);
> + if ( rc != 0 )
I think the point of setting errno here is because posix_memalign
doesn't set it and instead returns an error code. The caller of
init_page uses PERROR in order to print the error which his expected to
be in errno.
I don't think this is the only place in Xen code that errno is set, why
are the others fine but not this instance?
Thanks, Roger.
|