HaikuDepot: Do not inadvertently modify the real errno.

Found by GCC 11 warnings.
This commit is contained in:
Augustin Cavalier 2021-11-17 21:09:31 -05:00
parent eeddcfffbe
commit 91a0b53040

View File

@ -116,20 +116,20 @@ ServerHelper::NotifyTransportError(status_t error)
/*static*/ void /*static*/ void
ServerHelper::AlertTransportError(BMessage* message) ServerHelper::AlertTransportError(BMessage* message)
{ {
status_t errno = B_OK; status_t error = B_OK;
int64 errnoInt64; int64 errnoInt64;
message->FindInt64("errno", &errnoInt64); message->FindInt64("errno", &errnoInt64);
errno = (status_t) errnoInt64; error = (status_t) errnoInt64;
BString errorDescription("?"); BString errorDescription("?");
BString alertText; BString alertText;
switch (errno) { switch (error) {
case HD_NETWORK_INACCESSIBLE: case HD_NETWORK_INACCESSIBLE:
errorDescription = B_TRANSLATE("Network error"); errorDescription = B_TRANSLATE("Network error");
break; break;
default: default:
errorDescription.SetTo(strerror(errno)); errorDescription.SetTo(strerror(error));
break; break;
} }