public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/cygwin-3_5-branch] Cygwin: Map ERROR_NO_SUCH_DEVICE and ERROR_MEDIA_CHANGED to ENODEV
@ 2024-02-24 12:13 Corinna Vinschen
  0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2024-02-24 12:13 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ec5ef42f545699ba02f53ce5b89b7dfc7e92d7ca

commit ec5ef42f545699ba02f53ce5b89b7dfc7e92d7ca
Author:     Christian Franke <christian.franke@t-online.de>
AuthorDate: Fri Feb 23 19:01:09 2024 +0100
Commit:     Corinna Vinschen <corinna@vinschen.de>
CommitDate: Sat Feb 24 13:12:37 2024 +0100

    Cygwin: Map ERROR_NO_SUCH_DEVICE and ERROR_MEDIA_CHANGED to ENODEV
    
    If a removable (USB) device is disconnected after opening its raw
    device, R/W attempts fail with ERROR_NO_SUCH_DEVICE(433).  If the
    raw device of a partition is used, ERROR_MEDIA_CHANGED(1110) is
    returned instead.  Both are mapped to ENODEV(19) because <errno.h>
    does not offer a value which better matches ERROR_MEDIA_CHANGED.
    
    Signed-off-by: Christian Franke <christian.franke@t-online.de>

Diff:
---
 winsup/cygwin/local_includes/errmap.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/local_includes/errmap.h b/winsup/cygwin/local_includes/errmap.h
index 326b35b6c22c..a0b3ff400644 100644
--- a/winsup/cygwin/local_includes/errmap.h
+++ b/winsup/cygwin/local_includes/errmap.h
@@ -438,7 +438,7 @@ static const int errmap[] =
   0,			/* 430 */
   0,			/* 431 */
   0,			/* 432 */
-  0,			/* 433 */
+  ENODEV,		/* ERROR_NO_SUCH_DEVICE */
   0,			/* 434 */
   0,			/* 435 */
   0,			/* 436 */
@@ -1115,7 +1115,7 @@ static const int errmap[] =
   0,			/* ERROR_DEVICE_NOT_PARTITIONED */
   0,			/* ERROR_UNABLE_TO_LOCK_MEDIA */
   0,			/* ERROR_UNABLE_TO_UNLOAD_MEDIA */
-  0,			/* ERROR_MEDIA_CHANGED */
+  ENODEV,		/* ERROR_MEDIA_CHANGED */
   EIO,			/* ERROR_BUS_RESET */
   ENOMEDIUM,		/* ERROR_NO_MEDIA_IN_DRIVE */
   0,			/* ERROR_NO_UNICODE_TRANSLATION */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-24 12:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-24 12:13 [newlib-cygwin/cygwin-3_5-branch] Cygwin: Map ERROR_NO_SUCH_DEVICE and ERROR_MEDIA_CHANGED to ENODEV Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).