From a723366660c9f9282d9c73db59e4e64ef051accb Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 30 Aug 2013 17:39:11 +0000 Subject: [PATCH] * fhandler_tape.cc (mtinfo_drive::open): Handle bus reset gracefully after opening the device. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler_tape.cc | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 + + * fhandler_tape.cc (mtinfo_drive::open): Handle bus reset gracefully + after opening the device. + 2013-08-30 Christopher Faylor * 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)