diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 43adbacc4..83fc78955 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,12 @@ +2013-08-20 Corinna Vinschen + + * fhandler_tape.cc (mtinfo_drive::create_partitions): Fix long-standing + bug disabling creation of two partitions on drives supporting initiator + partitions. + (mtinfo_drive::set_blocksize): Update media information after setting + blocksize succeeded. + (mtinfo_drive::get_status): Fetch fresh media information. + 2013-08-19 Corinna Vinschen * lc_msg.h: Regenerate. diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc index 2b848303f..8002b955d 100644 --- a/winsup/cygwin/fhandler_tape.cc +++ b/winsup/cygwin/fhandler_tape.cc @@ -557,9 +557,8 @@ mtinfo_drive::create_partitions (HANDLE mt, int32_t count) debug_printf ("Format tape with %s partition(s)", count <= 0 ? "one" : "two"); if (get_feature (TAPE_DRIVE_INITIATOR)) { - if (count <= 0) - TAPE_FUNC (CreateTapePartition (mt, TAPE_INITIATOR_PARTITIONS, - count <= 0 ? 0 : 2, (DWORD) count)); + TAPE_FUNC (CreateTapePartition (mt, TAPE_INITIATOR_PARTITIONS, + count <= 0 ? 0 : 2, (DWORD) count)); } else if (get_feature (TAPE_DRIVE_FIXED)) { @@ -741,7 +740,8 @@ mtinfo_drive::set_blocksize (HANDLE mt, DWORD count) { TAPE_SET_MEDIA_PARAMETERS smp = {count}; TAPE_FUNC (SetTapeParameters (mt, SET_TAPE_MEDIA_INFORMATION, &smp)); - return error ("set_blocksize"); + /* Make sure to update blocksize info! */ + return lasterr ? error ("set_blocksize") : get_mp (mt); } int @@ -756,6 +756,9 @@ mtinfo_drive::get_status (HANDLE mt, struct mtget *get) if ((tstat = GetTapeStatus (mt)) == ERROR_NO_MEDIA_IN_DRIVE) notape = 1; + if (get_mp (mt)) + return lasterr; + memset (get, 0, sizeof *get); get->mt_type = MT_ISUNKNOWN; diff --git a/winsup/cygwin/release/1.7.25 b/winsup/cygwin/release/1.7.25 new file mode 100644 index 000000000..b3fb78043 --- /dev/null +++ b/winsup/cygwin/release/1.7.25 @@ -0,0 +1,15 @@ +What's new: +----------- + + +What changed: +------------- + + +Bug fixes: +---------- + +- Fix creating two partitions on tape drives supporting initiator partitions. + +- Update the internally used blocksize after setting a new blocksize for the + current tape.