Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-08-30 21:39:11 +0400
committerCorinna Vinschen <corinna@vinschen.de>2013-08-30 21:39:11 +0400
commita723366660c9f9282d9c73db59e4e64ef051accb (patch)
tree166b1b29cada1659a1fb5e0536412042c9c3a6d7
parentc5abf768f9d9cacdddcecdc20b366513cbf91b8c (diff)
* fhandler_tape.cc (mtinfo_drive::open): Handle bus reset gracefully
after opening the device.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler_tape.cc5
2 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 976fcde2c..8c3907993 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-30 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_tape.cc (mtinfo_drive::open): Handle bus reset gracefully
+ after opening the device.
+
2013-08-30 Christopher Faylor <me.cygwin2013@cgf.cx>
* sigproc.cc (pending_signals::add): Properly maintain linked list.
diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc
index 14f3e9d1b..eb35f6599 100644
--- a/winsup/cygwin/fhandler_tape.cc
+++ b/winsup/cygwin/fhandler_tape.cc
@@ -107,7 +107,10 @@ mtinfo_drive::get_mp (HANDLE mt)
int
mtinfo_drive::open (HANDLE mt)
{
- get_dp (mt);
+ /* First access after opening the device can return BUS RESET, but we
+ need the drive parameters, so just try again. */
+ while (get_dp (mt) == ERROR_BUS_RESET)
+ ;
get_mp (mt);
get_pos (mt);
if (partition < MAX_PARTITION_NUM && part (partition)->block != block)