From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 9A41D7803E4 for ; Wed, 17 Jul 2024 07:01:19 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=RdzBC6fckSVSkBnhr7vTyjkxcSROdKFoiWhsy0uKDwQ=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1721199679; v=1; b=xfAnJ7BbMt5/8EvmUME7ydipMCH4HZUwvQF3UyhX+WrL0r5xag97jljH+Glawp6Z+sJLuCms LdmXJ6AIyCzoWcCzwWMUvf9JeUkePdQ5xSbBnJc/E/3M/7AB7b2+YmJsuNF6CtzoHZ9gUHqAENj jVqLwGJF8+eyp4/6aZTfz267tJiZmwJzXAEe7yMzSwh+7oSOTg8arRerlt1wTJAJ1Q4GZniQZfF 99s024swD8FfAOAWmJpNLQ0X4u1DCk5oPuiyvYpemHv0ySTUZsLsle/yX6UEvDdvPea3andFoFF CxGPHIGDU37mu9P5fiknxlzl3O5j0QX4JgHv9CpXzBq/w== X-Received: by 127.0.0.2 with SMTP id L5daYY7687511xyGq1R5mLvL; Wed, 17 Jul 2024 00:01:18 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by mx.groups.io with SMTP id smtpd.web10.9541.1721199676217838727 for ; Wed, 17 Jul 2024 00:01:17 -0700 X-CSE-ConnectionGUID: FQw0THZxRW2phBQjQNlPpQ== X-CSE-MsgGUID: m/mMpCByQ7Szt/BQIdcDjA== X-IronPort-AV: E=McAfee;i="6700,10204,11135"; a="30093625" X-IronPort-AV: E=Sophos;i="6.09,214,1716274800"; d="scan'208";a="30093625" X-Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2024 00:01:17 -0700 X-CSE-ConnectionGUID: Qi/7iiFTSK6Ri0w0JzYqsA== X-CSE-MsgGUID: rDuFOGoyS0iXdfLn0Ct1nA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,214,1716274800"; d="scan'208";a="50358209" X-Received: from njayapra-mobl.gar.corp.intel.com ([10.247.147.19]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2024 00:01:02 -0700 From: "Jayaprakash, N" To: devel@edk2.groups.io Cc: Jayaprakash N , Rebecca Cran , Michael D Kinney Subject: [edk2-devel] [edk2-libc Patch 1/1] edk2-libc: Support for compiling Python UEFI interpreter with VS2022 Date: Wed, 17 Jul 2024 12:29:29 +0530 Message-ID: <20240717070053.323-2-n.jayaprakash@intel.com> In-Reply-To: <20240717070053.323-1-n.jayaprakash@intel.com> References: <20240717070053.323-1-n.jayaprakash@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 17 Jul 2024 00:01:17 -0700 Resent-From: n.jayaprakash@intel.com Reply-To: devel@edk2.groups.io,n.jayaprakash@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: XiW8ftATgGaVtauRp4ZqDkkzx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=xfAnJ7Bb; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4811 This commit fixes the compilation issues observed with several components in the edk2-libc repo while trying to compile Python interpreter for UEFI. Cc: Rebecca Cran Cc: Michael D Kinney Cc: Jayaprakash N Signed-off-by: Jayaprakash N --- AppPkg/Applications/Enquire/Enquire.c | 48 +++++------ .../OrderedCollectionTest.c | 10 +-- .../Sockets/DataSource/DataSource.c | 10 +-- AppPkg/Applications/Sockets/OobRx/OobRx.c | 4 +- .../Applications/Sockets/RawIp4Rx/RawIp4Rx.c | 4 +- StdLib/BsdSocketLib/getnetbyht.c | 9 ++- StdLib/BsdSocketLib/ns_print.c | 57 +++++++------ StdLib/EfiSocketLib/Socket.c | 80 +++++++++---------- 8 files changed, 116 insertions(+), 106 deletions(-) diff --git a/AppPkg/Applications/Enquire/Enquire.c b/AppPkg/Applications/Enquire/Enquire.c index 1e1db69..5e34f48 100644 --- a/AppPkg/Applications/Enquire/Enquire.c +++ b/AppPkg/Applications/Enquire/Enquire.c @@ -5,7 +5,7 @@ Steven Pemberton, CWI, Amsterdam; "Steven.Pemberton@cwi.nl" Used with permission. - Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -918,15 +918,15 @@ memeq( } Void -farewell(int bugs) +farewell(int bugs_local) { - if (bugs == 0) exit(0); + if (bugs_local == 0) exit(0); printf("\n%sFor hints on dealing with the ", co); - if (bugs == 1) printf("problem"); - else printf("%d problems", bugs); + if (bugs_local == 1) printf("problem"); + else printf("%d problems", bugs_local); printf(" above\n see the section 'TROUBLESHOOTING' in the file "); printf("%s%s\n", FILENAME, oc); - exit(bugs); + exit(bugs_local); } /* The program has received a signal where it wasn't expecting one */ @@ -1927,51 +1927,51 @@ int cprop( void ) if (c_signed) { #ifndef NO_UC -/* Syntax error? Define NO_UC */ Volatile unsigned char c1, char_max; - c1=0; char_max=0; +/* Syntax error? Define NO_UC */ Volatile unsigned char c1, char_max_local; + c1=0; char_max_local=0; c1++; - if (setjmp(lab)==0) { /* Yields char_max */ - while (c1>char_max) { - char_max=c1; + if (setjmp(lab)==0) { /* Yields char_max_local */ + while (c1>char_max_local) { + char_max_local=c1; c1++; } } Unexpected(4); if (sizeof(char) == sizeof(int)) { u_define(D_UCHAR_MAX, "", "UCHAR", "_MAX", - (ulong) char_max, + (ulong) char_max_local, (ulong) UCHAR_MAX, ""); } else { i_define(D_UCHAR_MAX, "", "UCHAR", "_MAX", - (long) char_max, 0L, + (long) char_max_local, 0L, (long) UCHAR_MAX, ""); } #endif } else { #ifndef NO_SC -/* Syntax error? Define NO_SC */ Volatile signed char c1, char_max, char_min; - c1=0; char_max=0; +/* Syntax error? Define NO_SC */ Volatile signed char c1, char_max_local, char_min_local; + c1=0; char_max_local=0; c1++; - if (setjmp(lab)==0) { /* Yields char_max */ - while (c1>char_max) { - char_max=c1; + if (setjmp(lab)==0) { /* Yields char_max_local */ + while (c1>char_max_local) { + char_max_local=c1; c1++; } } - c1=0; char_min=0; + c1=0; char_min_local=0; c1--; - if (setjmp(lab)==0) { /* Yields char_min */ - while (c1 + Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -458,10 +458,10 @@ SetupInputOutput ( case 'h': fprintf (stderr, - "%1$s: simple OrderedCollectionLib tester\n" + "%s: simple OrderedCollectionLib tester\n" "\n" - "Usage: 1. %1$s [-i InputFile] [-o OutputFile]\n" - " 2. %1$s -h\n" + "Usage: 1. %s [-i InputFile] [-o OutputFile]\n" + " 2. %s -h\n" "\n" "Options:\n" " -i InputFile : read commands from InputFile\n" @@ -469,7 +469,7 @@ SetupInputOutput ( " -o OutputFile: write command responses to OutputFile\n" " (will write to stdout if absent)\n" " -h : print this help and exit\n" - "\n", ArgV[0]); + "\n", ArgV[0], ArgV[0], ArgV[0]); ListCommands (); exit (EXIT_SUCCESS); diff --git a/AppPkg/Applications/Sockets/DataSource/DataSource.c b/AppPkg/Applications/Sockets/DataSource/DataSource.c index 360689e..0ca6a9a 100644 --- a/AppPkg/Applications/Sockets/DataSource/DataSource.c +++ b/AppPkg/Applications/Sockets/DataSource/DataSource.c @@ -1,7 +1,7 @@ /** @file Data source for network testing. - Copyright (c) 2011-2012, Intel Corporation. All rights reserved. + Copyright (c) 2011-2024, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -538,7 +538,7 @@ EFI_STATUS SocketSend ( ) { - size_t BytesSent; + size_t BytesSentLocal; EFI_STATUS Status; EFI_TPL TplPrevious; @@ -562,8 +562,8 @@ SocketSend ( // // Send some bytes // - BytesSent = write ( Socket, &Buffer[0], sizeof ( Buffer )); - if ( -1 == BytesSent ) { + BytesSentLocal = write ( Socket, &Buffer[0], sizeof ( Buffer )); + if ( -1 == BytesSentLocal ) { DEBUG (( DEBUG_INFO, "ERROR: send failed, errno: %d\r\n", errno )); @@ -589,7 +589,7 @@ Status = EFI_NOT_STARTED; // // Account for the data sent // - TotalBytesSent += BytesSent; + TotalBytesSent += BytesSentLocal; // // Release the TimerCallback routine synchronization diff --git a/AppPkg/Applications/Sockets/OobRx/OobRx.c b/AppPkg/Applications/Sockets/OobRx/OobRx.c index 28e10d8..af07127 100644 --- a/AppPkg/Applications/Sockets/OobRx/OobRx.c +++ b/AppPkg/Applications/Sockets/OobRx/OobRx.c @@ -150,7 +150,7 @@ OobRx ( // // Display the received OOB data // - printf ( "%5Ld OOB bytes received\r\n", (UINT64)BytesReceived ); + printf ( "%5llu OOB bytes received\r\n", (UINT64)BytesReceived ); // // Account for the bytes received @@ -183,7 +183,7 @@ OobRx ( // // Display the received data // - printf ( "%4Ld bytes received\r\n", (UINT64)BytesReceived ); + printf ( "%4llu bytes received\r\n", (UINT64)BytesReceived ); // // Account for the bytes received diff --git a/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.c b/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.c index b52cd38..b190b44 100644 --- a/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.c +++ b/AppPkg/Applications/Sockets/RawIp4Rx/RawIp4Rx.c @@ -1,7 +1,7 @@ /** @file Raw IP4 receive application - Copyright (c) 2011-2012, Intel Corporation. All rights reserved. + Copyright (c) 2011-2024, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -157,7 +157,7 @@ RawIp4Rx ( // Display the bytes received // if ( 0 == RetVal ) { - printf ( "Total Bytes Received: %Ld\r\n", TotalBytesReceived ); + printf ( "Total Bytes Received: %llu\r\n", TotalBytesReceived ); } // diff --git a/StdLib/BsdSocketLib/getnetbyht.c b/StdLib/BsdSocketLib/getnetbyht.c index 08b8042..5907d44 100644 --- a/StdLib/BsdSocketLib/getnetbyht.c +++ b/StdLib/BsdSocketLib/getnetbyht.c @@ -41,6 +41,11 @@ * from getnetent.c 1.1 (Coimbra) 93/06/02 */ +/* + * Copyright (c) 2024, Intel Corporation. All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause-Patent + */ + #if defined(LIBC_SCCS) && !defined(lint) static char sccsid[] = "@(#)getnetent.c 8.1 (Berkeley) 6/4/93"; static char orig_rcsid[] = "From: Id: getnetent.c,v 8.4 1997/06/01 20:34:37 vixie Exp"; @@ -155,13 +160,13 @@ found: } struct netent * -_getnetbyhtaddr(register unsigned long net, register int type) +_getnetbyhtaddr(register unsigned long net_local, register int type) { register struct netent *p; setnetent(_net_stayopen); while ( NULL != (p = getnetent()) ) - if (p->n_addrtype == type && p->n_net == net) + if (p->n_addrtype == type && p->n_net == net_local) break; if (!_net_stayopen) endnetent(); diff --git a/StdLib/BsdSocketLib/ns_print.c b/StdLib/BsdSocketLib/ns_print.c index ea29d01..fb19bf9 100644 --- a/StdLib/BsdSocketLib/ns_print.c +++ b/StdLib/BsdSocketLib/ns_print.c @@ -55,6 +55,11 @@ * */ +/* + * Copyright (c) 2024, Intel Corporation. All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause-Patent + */ + /* Import. */ #include @@ -211,7 +216,7 @@ ns_sprintrrf(const u_char *msg, size_t msglen, break; case ns_t_soa: { - u_long t; + u_long t_local; /* Server name. */ T(addname(msg, msglen, &rdata, origin, &buf, &buflen)); @@ -226,45 +231,45 @@ ns_sprintrrf(const u_char *msg, size_t msglen, goto formerr; /* Serial number. */ - t = ns_get32(rdata); rdata += NS_INT32SZ; + t_local = ns_get32(rdata); rdata += NS_INT32SZ; T(addstr("\t\t\t\t\t", 5, &buf, &buflen)); - len = SPRINTF((tmp, "%lu", (unsigned long)t)); + len = SPRINTF((tmp, "%lu", (unsigned long)t_local)); T(addstr(tmp, len, &buf, &buflen)); T(spaced = addtab(len, 16, spaced, &buf, &buflen)); T(addstr("; serial\n", 9, &buf, &buflen)); spaced = 0; /* Refresh interval. */ - t = ns_get32(rdata); rdata += NS_INT32SZ; + t_local = ns_get32(rdata); rdata += NS_INT32SZ; T(addstr("\t\t\t\t\t", 5, &buf, &buflen)); - T(len = ns_format_ttl(t, buf, buflen)); + T(len = ns_format_ttl(t_local, buf, buflen)); addlen(len, &buf, &buflen); T(spaced = addtab(len, 16, spaced, &buf, &buflen)); T(addstr("; refresh\n", 10, &buf, &buflen)); spaced = 0; /* Retry interval. */ - t = ns_get32(rdata); rdata += NS_INT32SZ; + t_local = ns_get32(rdata); rdata += NS_INT32SZ; T(addstr("\t\t\t\t\t", 5, &buf, &buflen)); - T(len = ns_format_ttl(t, buf, buflen)); + T(len = ns_format_ttl(t_local, buf, buflen)); addlen(len, &buf, &buflen); T(spaced = addtab(len, 16, spaced, &buf, &buflen)); T(addstr("; retry\n", 8, &buf, &buflen)); spaced = 0; /* Expiry. */ - t = ns_get32(rdata); rdata += NS_INT32SZ; + t_local = ns_get32(rdata); rdata += NS_INT32SZ; T(addstr("\t\t\t\t\t", 5, &buf, &buflen)); - T(len = ns_format_ttl(t, buf, buflen)); + T(len = ns_format_ttl(t_local, buf, buflen)); addlen(len, &buf, &buflen); T(spaced = addtab(len, 16, spaced, &buf, &buflen)); T(addstr("; expiry\n", 9, &buf, &buflen)); spaced = 0; /* Minimum TTL. */ - t = ns_get32(rdata); rdata += NS_INT32SZ; + t_local = ns_get32(rdata); rdata += NS_INT32SZ; T(addstr("\t\t\t\t\t", 5, &buf, &buflen)); - T(len = ns_format_ttl(t, buf, buflen)); + T(len = ns_format_ttl(t_local, buf, buflen)); addlen(len, &buf, &buflen); T(addstr(" )", 2, &buf, &buflen)); T(spaced = addtab(len, 16, spaced, &buf, &buflen)); @@ -276,15 +281,15 @@ ns_sprintrrf(const u_char *msg, size_t msglen, case ns_t_mx: case ns_t_afsdb: case ns_t_rt: { - u_int t; + u_int t_local; if (rdlen < NS_INT16SZ) goto formerr; /* Priority. */ - t = ns_get16(rdata); + t_local = ns_get16(rdata); rdata += NS_INT16SZ; - len = SPRINTF((tmp, "%u ", (unsigned int)t)); + len = SPRINTF((tmp, "%u ", (unsigned int)t_local)); T(addstr(tmp, len, &buf, &buflen)); /* Target. */ @@ -294,15 +299,15 @@ ns_sprintrrf(const u_char *msg, size_t msglen, } case ns_t_px: { - u_int t; + u_int t_local; if (rdlen < NS_INT16SZ) goto formerr; /* Priority. */ - t = ns_get16(rdata); + t_local = ns_get16(rdata); rdata += NS_INT16SZ; - len = SPRINTF((tmp, "%u ", (unsigned int)t)); + len = SPRINTF((tmp, "%u ", (unsigned int)t_local)); T(addstr(tmp, len, &buf, &buflen)); /* Name1. */ @@ -503,33 +508,33 @@ ns_sprintrrf(const u_char *msg, size_t msglen, } case ns_t_sig: { - u_int type, algorithm, labels, footprint; + u_int type_local, algorithm, labels, footprint; const char *leader; - u_long t; + u_long t_local; int n; if (rdlen < 22) goto formerr; /* Type covered, Algorithm, Label count, Original TTL. */ - type = ns_get16(rdata); rdata += NS_INT16SZ; + type_local = ns_get16(rdata); rdata += NS_INT16SZ; algorithm = *rdata++; labels = *rdata++; - t = ns_get32(rdata); rdata += NS_INT32SZ; + t_local = ns_get32(rdata); rdata += NS_INT32SZ; len = SPRINTF((tmp, " %s %d %lu ", - p_type((int)type), (int)algorithm, (unsigned long)t)); + p_type((int)type_local), (int)algorithm, (unsigned long)t_local)); T(addstr(tmp, len, &buf, &buflen)); if (labels != (u_int)dn_count_labels(name)) goto formerr; /* Signature expiry. */ - t = ns_get32(rdata); rdata += NS_INT32SZ; - len = SPRINTF((tmp, "%s ", p_secstodate(t))); + t_local = ns_get32(rdata); rdata += NS_INT32SZ; + len = SPRINTF((tmp, "%s ", p_secstodate(t_local))); T(addstr(tmp, len, &buf, &buflen)); /* Time signed. */ - t = ns_get32(rdata); rdata += NS_INT32SZ; - len = SPRINTF((tmp, "%s ", p_secstodate(t))); + t_local = ns_get32(rdata); rdata += NS_INT32SZ; + len = SPRINTF((tmp, "%s ", p_secstodate(t_local))); T(addstr(tmp, len, &buf, &buflen)); /* Signature Footprint. */ diff --git a/StdLib/EfiSocketLib/Socket.c b/StdLib/EfiSocketLib/Socket.c index ee15b62..5f91744 100644 --- a/StdLib/EfiSocketLib/Socket.c +++ b/StdLib/EfiSocketLib/Socket.c @@ -5,7 +5,7 @@ * Bound - pSocket->PortList is not NULL * Listen - AcceptWait event is not NULL - Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
+ Copyright (c) 2010 - 2024, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent @@ -570,7 +570,7 @@ EslSocket ( int ApiArraySize; ESL_SOCKET * pSocket; EFI_STATUS Status; - int errno; + int error_num; DBG_ENTER ( ); @@ -583,7 +583,7 @@ EslSocket ( } // Assume success - errno = 0; + error_num = 0; Status = EFI_SUCCESS; // Use break instead of goto @@ -595,7 +595,7 @@ EslSocket ( DEBUG (( DEBUG_ERROR | DEBUG_SOCKET, "ERROR - Invalid domain value\r\n" )); Status = EFI_INVALID_PARAMETER; - errno = EAFNOSUPPORT; + error_num = EAFNOSUPPORT; break; } @@ -625,7 +625,7 @@ EslSocket ( "ERROR - Invalid type value\r\n" )); // The socket type is not supported Status = EFI_INVALID_PARAMETER; - errno = EPROTOTYPE; + error_num = EPROTOTYPE; break; } @@ -665,15 +665,15 @@ EslSocket ( if ( ppApiArrayEnd <= ppApiArray ) { DEBUG (( DEBUG_ERROR | DEBUG_SOCKET, "ERROR - The protocol is not supported!\r\n" )); - errno = EPROTONOSUPPORT; + error_num = EPROTONOSUPPORT; break; } // The driver does not support this protocol DEBUG (( DEBUG_ERROR | DEBUG_SOCKET, "ERROR - The protocol does not support this socket type!\r\n" )); - errno = EPROTONOSUPPORT; - errno = EPROTOTYPE; + error_num = EPROTONOSUPPORT; + error_num = EPROTOTYPE; break; } // Save the socket attributes @@ -687,7 +687,7 @@ EslSocket ( } // Return the operation status if ( NULL != pErrno ) { - *pErrno = errno; + *pErrno = error_num; } DBG_EXIT_STATUS ( Status ); return Status; @@ -1334,7 +1334,7 @@ EslSocketClosePoll ( IN int * pErrno ) { - int errno; + int error_num; ESL_LAYER * pLayer; ESL_SOCKET * pNextSocket; ESL_SOCKET * pSocket; @@ -1346,7 +1346,7 @@ EslSocketClosePoll ( // // Assume success // - errno = 0; + error_num = 0; Status = EFI_SUCCESS; // @@ -1401,7 +1401,7 @@ EslSocketClosePoll ( // At least one port is still open // Status = EFI_NOT_READY; - errno = EAGAIN; + error_num = EAGAIN; } } else { @@ -1409,7 +1409,7 @@ EslSocketClosePoll ( // SocketCloseStart was not called // Status = EFI_NOT_STARTED; - errno = EPERM; + error_num = EPERM; } break; } @@ -1428,7 +1428,7 @@ EslSocketClosePoll ( // Socket not found // Status = EFI_NOT_FOUND; - errno = ENOTSOCK; + error_num = ENOTSOCK; } // @@ -1440,7 +1440,7 @@ EslSocketClosePoll ( // Return the operation status // if ( NULL != pErrno ) { - *pErrno = errno; + *pErrno = error_num; } DBG_EXIT_STATUS ( Status ); return Status; @@ -1477,7 +1477,7 @@ EslSocketCloseStart ( IN int * pErrno ) { - int errno; + int error_num; ESL_PORT * pNextPort; ESL_PORT * pPort; ESL_SOCKET * pSocket; @@ -1490,7 +1490,7 @@ EslSocketCloseStart ( // Assume success // Status = EFI_SUCCESS; - errno = 0; + error_num = 0; // // Synchronize with the socket layer @@ -1521,7 +1521,7 @@ EslSocketCloseStart ( DEBUG_CLOSE | DEBUG_LISTEN | DEBUG_CONNECTION ); if (( EFI_SUCCESS != Status ) && ( EFI_NOT_READY != Status )) { - errno = EIO; + error_num = EIO; break; } @@ -1535,12 +1535,12 @@ EslSocketCloseStart ( // Attempt to finish closing the socket // if ( NULL == pPort ) { - Status = EslSocketClosePoll ( pSocketProtocol, &errno ); + Status = EslSocketClosePoll ( pSocketProtocol, &error_num ); } } else { Status = EFI_NOT_READY; - errno = EAGAIN; + error_num = EAGAIN; } // @@ -1552,7 +1552,7 @@ EslSocketCloseStart ( // Return the operation status // if ( NULL != pErrno ) { - *pErrno = errno; + *pErrno = error_num; } DBG_EXIT_STATUS ( Status ); return Status; @@ -1889,7 +1889,7 @@ EslSocketFree ( ) { EFI_HANDLE ChildHandle; - int errno; + int error_num; ESL_LAYER * pLayer; ESL_SOCKET * pSocket; ESL_SOCKET * pSocketPrevious; @@ -1901,7 +1901,7 @@ EslSocketFree ( // // Assume failure // - errno = EIO; + error_num = EIO; pSocket = NULL; Status = EFI_INVALID_PARAMETER; @@ -1986,7 +1986,7 @@ EslSocketFree ( "0x%08x: Free pSocket, %d bytes\r\n", pSocket, sizeof ( *pSocket ))); - errno = 0; + error_num = 0; } else { DEBUG (( DEBUG_ERROR | DEBUG_POOL, @@ -2014,10 +2014,10 @@ EslSocketFree ( } // - // Return the errno value if possible + // Return the error_num value if possible // if ( NULL != pErrno ) { - *pErrno = errno; + *pErrno = error_num; } // @@ -2751,7 +2751,7 @@ EslSocketOptionGet ( IN int * pErrno ) { - int errno; + int error_num; socklen_t LengthInBytes; socklen_t MaxBytes; CONST UINT8 * pOptionData; @@ -2763,7 +2763,7 @@ EslSocketOptionGet ( // // Assume failure // - errno = EINVAL; + error_num = EINVAL; Status = EFI_INVALID_PARAMETER; // @@ -2795,7 +2795,7 @@ EslSocketOptionGet ( OptionName, (CONST void ** __restrict)&pOptionData, &LengthInBytes ); - errno = pSocket->errno; + error_num = pSocket->errno; break; } else { @@ -2814,7 +2814,7 @@ EslSocketOptionGet ( "ERROR - %a does not support any options!\r\n", pSocket->pApi->pName )); } - errno = ENOPROTOOPT; + error_num = ENOPROTOOPT; Status = EFI_INVALID_PARAMETER; break; @@ -2825,7 +2825,7 @@ EslSocketOptionGet ( // Socket option not supported // DEBUG (( DEBUG_INFO | DEBUG_OPTION, "ERROR - Invalid socket option!\r\n" )); - errno = EINVAL; + error_num = EINVAL; Status = EFI_INVALID_PARAMETER; break; @@ -2927,7 +2927,7 @@ EslSocketOptionGet ( if ( LengthInBytes < MaxBytes ) { ZeroMem ( &((UINT8 *)pOptionValue)[LengthInBytes], MaxBytes - LengthInBytes ); } - errno = 0; + error_num = 0; Status = EFI_SUCCESS; } } @@ -2936,7 +2936,7 @@ EslSocketOptionGet ( // Return the operation status // if ( NULL != pErrno ) { - *pErrno = errno; + *pErrno = error_num; } DBG_EXIT_STATUS ( Status ); return Status; @@ -2971,7 +2971,7 @@ EslSocketOptionSet ( ) { BOOLEAN bTrueFalse; - int errno; + int error_num; socklen_t LengthInBytes; UINT8 * pOptionData; ESL_SOCKET * pSocket; @@ -2982,7 +2982,7 @@ EslSocketOptionSet ( // // Assume failure // - errno = EINVAL; + error_num = EINVAL; Status = EFI_INVALID_PARAMETER; // @@ -3015,7 +3015,7 @@ EslSocketOptionSet ( OptionName, pOptionValue, OptionLength ); - errno = pSocket->errno; + error_num = pSocket->errno; break; } else { @@ -3034,7 +3034,7 @@ EslSocketOptionSet ( "ERROR - %a does not support any options!\r\n", pSocket->pApi->pName )); } - errno = ENOPROTOOPT; + error_num = ENOPROTOOPT; Status = EFI_INVALID_PARAMETER; break; @@ -3046,7 +3046,7 @@ EslSocketOptionSet ( // DEBUG (( DEBUG_OPTION, "ERROR - Sockets does not support this option!\r\n" )); - errno = EINVAL; + error_num = EINVAL; Status = EFI_INVALID_PARAMETER; break; @@ -3133,7 +3133,7 @@ EslSocketOptionSet ( // Set the option value // CopyMem ( pOptionData, pOptionValue, LengthInBytes ); - errno = 0; + error_num = 0; Status = EFI_SUCCESS; } else { @@ -3150,7 +3150,7 @@ EslSocketOptionSet ( // Return the operation status // if ( NULL != pErrno ) { - *pErrno = errno; + *pErrno = error_num; } DBG_EXIT_STATUS ( Status ); return Status; -- 2.45.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119948): https://edk2.groups.io/g/devel/message/119948 Mute This Topic: https://groups.io/mt/107267145/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-