squashfs-tools/squashfs-fragmentsize.patch

30 lines
1.2 KiB
Diff
Raw Normal View History

diff -Naur old-mksquashfs/mksquashfs.c mksquashfs/mksquashfs.c
2006-09-18 16:57:07 +00:00
--- a/squashfs-tools/mksquashfs.c 2006-08-16 23:48:05.000000000 +0100
+++ b/squashfs-tools/mksquashfs.c 2006-08-16 23:50:18.000000000 +0100
@@ -985,7 +985,7 @@
}
for(i = 0; i < meta_blocks; i++) {
- int avail_bytes = i == meta_blocks - 1 ? frag_bytes % SQUASHFS_METADATA_SIZE : SQUASHFS_METADATA_SIZE;
+ int avail_bytes = frag_bytes > SQUASHFS_METADATA_SIZE ? SQUASHFS_METADATA_SIZE : frag_bytes;
c_byte = mangle(cbuffer + block_offset, buffer + i * SQUASHFS_METADATA_SIZE , avail_bytes, SQUASHFS_METADATA_SIZE, noF, 0);
if(!swap)
memcpy(cbuffer, &c_byte, sizeof(unsigned short));
@@ -997,6 +997,7 @@
compressed_size = SQUASHFS_COMPRESSED_SIZE(c_byte) + block_offset;
write_bytes(fd, bytes, compressed_size, cbuffer);
bytes += compressed_size;
+ frag_bytes -= avail_bytes;
}
if(!swap)
@@ -1791,7 +1792,7 @@
#define VERSION() \
- printf("mksquashfs version 3.0 (2006/03/15)\n");\
+ printf("mksquashfs version 3.0-patched (2006//08/16)\n");\
printf("copyright (C) 2006 Phillip Lougher <phillip@lougher.org.uk>\n\n"); \
printf("This program is free software; you can redistribute it and/or\n");\
printf("modify it under the terms of the GNU General Public License\n");\