summaryrefslogtreecommitdiff
path: root/emulators/hercules/patches
diff options
context:
space:
mode:
authoragc <agc>2001-02-22 11:34:58 +0000
committeragc <agc>2001-02-22 11:34:58 +0000
commitb9c03f58b88d18282c81cd4b2d3efcc87b8804ec (patch)
treee37cd3f146e9883b4101d3e30ad4a2d045a060a9 /emulators/hercules/patches
parentc45646dee917df3408ff24d126509b6108d2efb1 (diff)
downloadpkgsrc-b9c03f58b88d18282c81cd4b2d3efcc87b8804ec.tar.gz
Add one more patch, correcting sign extension in two places:
> From Wofgang Solfrank (ws@tools.de) > What I discovered was a problem in ckddasd.c, where there are two lseeks > with an offset of -(CKDDASD_RECHDR_SIZE). Now CKDDASD_RECHDR_SIZE is > defined (in hercules.h) as sizeof(CKDDASD_RECHDR), which happens to be > an unsigned int. Since the offset in the lseek (and in the ckd_lseek > that is used as an interface routine to it) is of type off_t, i.e. 64-bit, > the unsigned is zero-extended to 64 bits, and thus the sign is lost.
Diffstat (limited to 'emulators/hercules/patches')
-rw-r--r--emulators/hercules/patches/patch-af30
1 files changed, 30 insertions, 0 deletions
diff --git a/emulators/hercules/patches/patch-af b/emulators/hercules/patches/patch-af
new file mode 100644
index 00000000000..19d73caae3d
--- /dev/null
+++ b/emulators/hercules/patches/patch-af
@@ -0,0 +1,30 @@
+$NetBSD: patch-af,v 1.1 2001/02/22 11:34:59 agc Exp $
+
+> From Wofgang Solfrank (ws@tools.de)
+> What I discovered was a problem in ckddasd.c, where there are two lseeks
+> with an offset of -(CKDDASD_RECHDR_SIZE). Now CKDDASD_RECHDR_SIZE is
+> defined (in hercules.h) as sizeof(CKDDASD_RECHDR), which happens to be
+> an unsigned int. Since the offset in the lseek (and in the ckd_lseek
+> that is used as an interface routine to it) is of type off_t, i.e. 64-bit,
+> the unsigned is zero-extended to 64 bits, and thus the sign is lost.
+
+--- ckddasd.c 2001/02/22 10:54:55 1.1
++++ ckddasd.c 2001/02/22 10:55:26
+@@ -1663,7 +1663,7 @@
+ }
+
+ /* Backspace over end of track marker */
+- rc = ckd_lseek (dev, dev->fd, -(CKDDASD_RECHDR_SIZE), SEEK_CUR);
++ rc = ckd_lseek (dev, dev->fd, (int) -(CKDDASD_RECHDR_SIZE), SEEK_CUR);
+ if (rc == -1)
+ {
+ /* Handle seek error condition */
+@@ -1813,7 +1813,7 @@
+ }
+
+ /* Backspace over end of track marker */
+- rc = ckd_lseek (dev, dev->fd, -(CKDDASD_RECHDR_SIZE), SEEK_CUR);
++ rc = ckd_lseek (dev, dev->fd, (int) -(CKDDASD_RECHDR_SIZE), SEEK_CUR);
+ if (rc == -1)
+ {
+ /* Handle seek error condition */