Cygwin: tape: Handle non-standard "no medium" error code

Certain tape drives (known example: QUANTUM_ULTRIUM-HH6) return
the non-standard ERROR_NOT_READY rather than ERROR_NO_MEDIA_IN_DRIVE
if no media is present.  ERROR_NOT_READY is not documented as valid
return code from GetTapeStatus.  Without handling this error code
Cygwin's tape code can't report an offline state to user space.

Fix this by converting ERROR_NOT_READY to ERROR_NO_MEDIA_IN_DRIVE
where appropriate.

Add a debug_printf to mtinfo_drive::get_status to allow requesting
user info without having to rebuild the DLL.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2018-06-29 15:29:36 +02:00
parent 4b97244d12
commit 995d2a824a
2 changed files with 26 additions and 5 deletions

View File

@@ -40,3 +40,7 @@ Bug Fixes
- Fix Unicode table.
Addresses: https://cygwin.com/ml/cygwin/2018-06/msg00248.html
- Handle a non-standard return value from some tape drives to
report a "no-media" error.
Addresses: https://cygwin.com/ml/cygwin/2018-06/msg00245.html