From f495fb0e7c2bd3a42f16f81af18c64ffaba9a860 Mon Sep 17 00:00:00 2001
From: Christian Franke <christian.fra...@t-online.de>
Date: Tue, 27 Feb 2024 13:05:36 +0100
Subject: [PATCH 2/2] Cygwin: remove ENOSHARE and ECASECLASH from
 _sys_errlist[]

These errno values are no longer used by Cygwin.  Also add a
static_assert check for _sys_errlist[] size.

Signed-off-by: Christian Franke <christian.fra...@t-online.de>
---
 winsup/cygwin/errno.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/errno.cc b/winsup/cygwin/errno.cc
index 7d58e62ec..d8c057e51 100644
--- a/winsup/cygwin/errno.cc
+++ b/winsup/cygwin/errno.cc
@@ -167,8 +167,8 @@ const char *_sys_errlist[] =
 /* ESTALE 133 */         "Stale NFS file handle",
 /* ENOTSUP 134 */        "Not supported",
 /* ENOMEDIUM 135 */      "No medium found",
-/* ENOSHARE 136 */       "No such host or network path",
-/* ECASECLASH 137 */     "Filename exists with different case",
+                         NULL, /* Was ENOSHARE 136, no longer used. */
+                         NULL, /* Was ECASECLASH 137, no longer used. */
 /* EILSEQ 138 */         "Invalid or incomplete multibyte or wide character",
 /* EOVERFLOW 139 */      "Value too large for defined data type",
 /* ECANCELED 140 */      "Operation canceled",
@@ -177,6 +177,8 @@ const char *_sys_errlist[] =
 /* ESTRPIPE 143 */       "Streams pipe error"
 };
 
+static_assert(143 + 1 == sizeof (_sys_errlist) / sizeof (_sys_errlist[0]));
+
 int NO_COPY_INIT _sys_nerr = sizeof (_sys_errlist) / sizeof (_sys_errlist[0]);
 };
 
-- 
2.43.0

Reply via email to