diff options
author | amdmi3 <amdmi3@FreeBSD.org> | 2008-11-02 10:14:39 +0800 |
---|---|---|
committer | amdmi3 <amdmi3@FreeBSD.org> | 2008-11-02 10:14:39 +0800 |
commit | 925fcdd7064abaf4823a1884e98ad6deb1040a30 (patch) | |
tree | 2e3aeddd018793defb7847a95facef1f9708fa5a /sysutils/iat | |
parent | cbb781438ed44a9a7742837d725519dd6850351b (diff) | |
download | freebsd-ports-gnome-925fcdd7064abaf4823a1884e98ad6deb1040a30.tar.gz freebsd-ports-gnome-925fcdd7064abaf4823a1884e98ad6deb1040a30.tar.zst freebsd-ports-gnome-925fcdd7064abaf4823a1884e98ad6deb1040a30.zip |
- Add support for large files (>4Gb)
Diffstat (limited to 'sysutils/iat')
-rw-r--r-- | sysutils/iat/Makefile | 1 | ||||
-rw-r--r-- | sysutils/iat/files/patch-src-iat.c | 61 |
2 files changed, 57 insertions, 5 deletions
diff --git a/sysutils/iat/Makefile b/sysutils/iat/Makefile index 8d92021fa138..6d1482c04e0b 100644 --- a/sysutils/iat/Makefile +++ b/sysutils/iat/Makefile @@ -7,6 +7,7 @@ PORTNAME= iat PORTVERSION= 0.1.3 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_BERLIOS} MASTER_SITE_SUBDIR= ${PORTNAME} diff --git a/sysutils/iat/files/patch-src-iat.c b/sysutils/iat/files/patch-src-iat.c index 3a19cee3ab21..20a7970e9a3b 100644 --- a/sysutils/iat/files/patch-src-iat.c +++ b/sysutils/iat/files/patch-src-iat.c @@ -1,5 +1,5 @@ ---- src/iat.c.orig Fri Mar 30 22:39:59 2007 -+++ src/iat.c Fri Mar 30 22:40:46 2007 +--- src/iat.c.orig 2008-11-02 05:00:31.000000000 +0300 ++++ src/iat.c 2008-11-02 05:01:16.000000000 +0300 @@ -14,12 +14,20 @@ along with this program; if not, write to the Free Software Foundation, Inc., @@ -35,6 +35,15 @@ /* Signature for Image ISO-9660 */ const char ISO_9660_START[] = { (char) 0x01, +@@ -91,7 +105,7 @@ + }; + + +-long img_size; ++off_t img_size; + int img_detect = 2; + + int img_header = 0; @@ -106,35 +120,49 @@ int previous_percent=-1; @@ -104,7 +113,33 @@ } -@@ -163,21 +191,24 @@ +@@ -142,15 +170,15 @@ + int image_convert() + { + +- long source_length, i; ++ off_t source_length, i; + char buf[2448]; + + +- fseek (fsource, 0L, SEEK_END); +- source_length = (ftell (fsource) - img_offset) / img_size_sector; ++ fseeko (fsource, 0L, SEEK_END); ++ source_length = (ftello (fsource) - img_offset) / img_size_sector; + + +- fseek (fsource, img_offset, SEEK_SET); ++ fseeko (fsource, img_offset, SEEK_SET); + + { + for (i = 0; i < source_length; i++) +@@ -158,26 +186,29 @@ + { + main_percent(i*100/source_length); + +- fseek (fsource, img_header, SEEK_CUR); ++ fseeko (fsource, img_header, SEEK_CUR); + if (fread (buf, sizeof (char), BLOCK_ISO_CD, fsource)); else { @@ -120,7 +155,8 @@ + fprintf (stderr, "%s\n", strerror (errno)); exit (EXIT_FAILURE); }; - fseek (fsource, img_ecc, SEEK_CUR); +- fseek (fsource, img_ecc, SEEK_CUR); ++ fseeko (fsource, img_ecc, SEEK_CUR); } } - printf ("100%% [:=====================:]\n"); @@ -133,7 +169,22 @@ } -@@ -207,12 +238,12 @@ +@@ -196,23 +227,23 @@ + int raw_check = 0; + + +-
fseek(fsource, 0L, SEEK_END); +-
img_size = (((ftell(fsource))) / 8); ++
fseeko(fsource, 0L, SEEK_END); ++
img_size = (((ftello(fsource))) / 8); +
for (i = 0; img_detect == 2; i = i + 1) + { +- fseek(fsource, 0L, SEEK_SET); +- fseek(fsource, i, SEEK_CUR); ++ fseeko(fsource, 0L, SEEK_SET); ++ fseeko(fsource, i, SEEK_CUR); + fread(buf, sizeof(char), 8, fsource); + fread(raw, sizeof(char), 12, fsource); if (!memcmp(ISO_9660_START, buf, 8)) { |