summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_tape.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-08-21 20:28:12 +0000
committerCorinna Vinschen <corinna@vinschen.de>2013-08-21 20:28:12 +0000
commit3ee82da30da28ad797c045571d29f20f4633c681 (patch)
tree7839697ddc4e47068df89fff5761855f07d5c3a2 /winsup/cygwin/fhandler_tape.cc
parent30990eaa2756af326d9f0100944b2340835f5434 (diff)
downloadcygnal-3ee82da30da28ad797c045571d29f20f4633c681.tar.gz
cygnal-3ee82da30da28ad797c045571d29f20f4633c681.tar.bz2
cygnal-3ee82da30da28ad797c045571d29f20f4633c681.zip
* fhandler_tape.cc (mtinfo_drive::create_partitions): Allow partitioning
of drives supporting select partitions. (mtinfo_drive::get_status): Fill in current partition and number of partitions on tape into mt_resid. * include/cygwin/mtio.h (struct mtget): Align mt_resid comment to aforementioned change. * include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
Diffstat (limited to 'winsup/cygwin/fhandler_tape.cc')
-rw-r--r--winsup/cygwin/fhandler_tape.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_tape.cc b/winsup/cygwin/fhandler_tape.cc
index 8002b955d..969ee7653 100644
--- a/winsup/cygwin/fhandler_tape.cc
+++ b/winsup/cygwin/fhandler_tape.cc
@@ -560,6 +560,11 @@ mtinfo_drive::create_partitions (HANDLE mt, int32_t count)
TAPE_FUNC (CreateTapePartition (mt, TAPE_INITIATOR_PARTITIONS,
count <= 0 ? 0 : 2, (DWORD) count));
}
+ else if (get_feature (TAPE_DRIVE_SELECT))
+ {
+ TAPE_FUNC (CreateTapePartition (mt, TAPE_SELECT_PARTITIONS,
+ count <= 0 ? 0 : 2, 0));
+ }
else if (get_feature (TAPE_DRIVE_FIXED))
{
/* This is supposed to work for Tandberg SLR drivers up to version
@@ -798,7 +803,8 @@ mtinfo_drive::get_status (HANDLE mt, struct mtget *get)
if (!notape)
{
- get->mt_resid = partition;
+ get->mt_resid = (partition & 0xffff)
+ | ((mp ()->PartitionCount & 0xffff) << 16);
get->mt_fileno = part (partition)->file;
get->mt_blkno = part (partition)->fblock;