dlls/ntdll/tape.c portability
Gerald Pfeifer
gerald at pfeifer.com
Thu Feb 2 15:22:48 CST 2006
On Mon, 30 Jan 2006, Gerald Pfeifer wrote:
> The addition of dlls/ntdll/tape.c broke the build on FreeBSD, and I
> assume all other non-Linux platforms.
>
> This is the first set of fixes, which address the majority of issues.
This is part two. FreeBSD does not have struct mtpos, but rather has
the relevant fields in struct mtget itself.
Gerald
ChangeLog:
On FreeBSD, struct mtget already contains all required information,
so we only have that, and not struct mtpos as on Linux.
Index: tape.c
===================================================================
RCS file: /home/wine/wine/dlls/ntdll/tape.c,v
retrieving revision 1.3
diff -u -3 -p -r1.3 tape.c
--- tape.c 31 Jan 2006 12:08:47 -0000 1.3
+++ tape.c 1 Feb 2006 18:31:14 -0000
@@ -226,7 +226,9 @@ static NTSTATUS TAPE_GetPosition( int fd
{
#ifdef HAVE_SYS_MTIO_H
struct mtget get;
+#ifndef __FreeBSD__
struct mtpos pos;
+#endif
NTSTATUS status;
TRACE( "fd: %d type: 0x%08lx\n", fd, type );
@@ -237,16 +239,22 @@ static NTSTATUS TAPE_GetPosition( int fd
if (status != STATUS_SUCCESS)
return status;
+#ifndef __FreeBSD__
status = TAPE_GetStatus( ioctl( fd, MTIOCPOS, &pos ) );
if (status != STATUS_SUCCESS)
return status;
+#endif
switch (type)
{
case TAPE_ABSOLUTE_BLOCK:
data->Type = type;
data->Partition = get.mt_resid;
+#ifndef __FreeBSD__
data->OffsetLow = pos.mt_blkno;
+#else
+ data->OffsetLow = get.mt_blkno;
+#endif
break;
case TAPE_LOGICAL_BLOCK:
case TAPE_PSEUDO_LOGICAL_BLOCK:
More information about the wine-patches
mailing list