From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id BBB98385841C; Sat, 24 Feb 2024 12:14:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BBB98385841C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708776858; bh=g7eO5Yny7YdmJ7YQ30j5aUW0gyF0EjdAr7Qu0XjLJN8=; h=From:To:Subject:Date:From; b=xrPU1zDwznKqIjNZ8EZqflPrgBuNrvRSmg3M6cMElHdZCjVpUh4vCse8acwqUJbZb jkYToQgDjRVF/HIla3mco80ETRbY9J+aM93lFGUmCCnediPggUhKda3stOTRpQOjMA XXG1Hm3DgytZq3a5K2ZtcJrhzhL8qntVbu4Yyijo= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: Map ERROR_NO_SUCH_DEVICE and ERROR_MEDIA_CHANGED to ENODEV X-Act-Checkin: newlib-cygwin X-Git-Author: Christian Franke X-Git-Refname: refs/heads/main X-Git-Oldrev: 388da83dce0477bdb91ec8f77691aaa67e5d966b X-Git-Newrev: 4af5f9d51e1da51647c365754dadc202ac33f8f2 Message-Id: <20240224121418.BBB98385841C@sourceware.org> Date: Sat, 24 Feb 2024 12:14:18 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D4af5f9d51e1= da51647c365754dadc202ac33f8f2 commit 4af5f9d51e1da51647c365754dadc202ac33f8f2 Author: Christian Franke AuthorDate: Fri Feb 23 19:01:09 2024 +0100 Commit: Corinna Vinschen CommitDate: Sat Feb 24 13:12:14 2024 +0100 Cygwin: Map ERROR_NO_SUCH_DEVICE and ERROR_MEDIA_CHANGED to ENODEV =20 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 does not offer a value which better matches ERROR_MEDIA_CHANGED. =20 Signed-off-by: Christian Franke 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_in= cludes/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[] =3D 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[] =3D 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 */