From eb51065b12fe901788733aa8b717cdc539c9a3cf Mon Sep 17 00:00:00 2001 From: is Date: Thu, 7 Dec 2000 14:11:36 +0000 Subject: Fix problem with sector sizes > 1024 bytes, creating version 3.9.5nb1. --- sysutils/mtools/Makefile | 3 ++- sysutils/mtools/patches/patch-af | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 sysutils/mtools/patches/patch-af diff --git a/sysutils/mtools/Makefile b/sysutils/mtools/Makefile index cad294db358..f53a9002d9b 100644 --- a/sysutils/mtools/Makefile +++ b/sysutils/mtools/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.19 2000/09/26 13:46:34 agc Exp $ +# $NetBSD: Makefile,v 1.20 2000/12/07 14:11:36 is Exp $ # DISTNAME= mtools-3.9.5 +PKGNAME= mtools-3.9.5nb1 CATEGORIES= sysutils MASTER_SITES= ftp://ftp.tux.org/pub/tux/knaff/mtools/ diff --git a/sysutils/mtools/patches/patch-af b/sysutils/mtools/patches/patch-af new file mode 100644 index 00000000000..563ca9ecf05 --- /dev/null +++ b/sysutils/mtools/patches/patch-af @@ -0,0 +1,40 @@ +$NetBSD: patch-af,v 1.1 2000/12/07 14:11:37 is Exp $ + +--- init.c.orig Fri Mar 19 09:57:59 1999 ++++ init.c +@@ -27,15 +27,30 @@ + */ + static int read_boot(Stream_t *Stream, struct bootsector * boot, int size) + { ++ int rc; ++ char *buf; ++ ++ buf = (char *)boot; ++ + /* read the first sector, or part of it */ + if(!size) + size = BOOTSIZE; +- if(size > 1024) +- size = 1024; + +- if (force_read(Stream, (char *) boot, 0, size) != size) +- return -1; +- return 0; ++ if (size > sizeof(struct bootsector)) { ++ buf = malloc(size); ++ if (!buf) ++ return(-1); ++ } ++ ++ rc = 0; ++ if (force_read(Stream, buf, 0, size) != size) ++ rc = -1; ++ ++ if (buf != (char *)boot) { ++ memcpy(boot, buf, sizeof(struct bootsector)); ++ free(buf); ++ } ++ return rc; + } + + static int fs_flush(Stream_t *Stream) -- cgit v1.2.3