summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-08-20 20:17:14 +0000
committerCorinna Vinschen <corinna@vinschen.de>2013-08-20 20:17:14 +0000
commit30990eaa2756af326d9f0100944b2340835f5434 (patch)
tree7c8d0d177c11b68d484fc5239359711a3bfb1fd1
parentf9268dfd7a869c5cc3009c8ea1f9a963beaf8c43 (diff)
downloadcygnal-30990eaa2756af326d9f0100944b2340835f5434.tar.gz
cygnal-30990eaa2756af326d9f0100944b2340835f5434.tar.bz2
cygnal-30990eaa2756af326d9f0100944b2340835f5434.zip
* 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.
-rw-r--r--winsup/cygwin/ChangeLog9
-rw-r--r--winsup/cygwin/fhandler_tape.cc11
-rw-r--r--winsup/cygwin/release/1.7.2515
3 files changed, 31 insertions, 4 deletions
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 <corinna@vinschen.de>
+
+ * 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 <corinna@vinschen.de>
* 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.