diff -ur util-linux-2.12q.org/disk-utils/fsck.cramfs.c util-linux-2.12q/disk-utils/fsck.cramfs.c --- util-linux-2.12q.org/disk-utils/fsck.cramfs.c 2004-12-11 15:53:16.000000000 +0100 +++ util-linux-2.12q/disk-utils/fsck.cramfs.c 2005-02-27 20:03:09.000000000 +0100 @@ -77,15 +77,7 @@ #define PAD_SIZE 512 #include -#ifdef PAGE_SIZE #define PAGE_CACHE_SIZE ((int) PAGE_SIZE) -#elif defined __ia64__ -#define PAGE_CACHE_SIZE (16384) -#elif defined __alpha__ -#define PAGE_CACHE_SIZE (8192) -#else -#define PAGE_CACHE_SIZE (4096) -#endif /* Guarantee access to at least 8kB at a time */ #define ROMBUFFER_BITS 13 @@ -95,11 +87,21 @@ static unsigned long read_buffer_block = ~0UL; /* Uncompressing data structures... */ -static char outbuffer[PAGE_CACHE_SIZE*2]; +static char *outbuffer; z_stream stream; #endif /* INCLUDE_FS_TESTS */ +static void init_statics(void) +{ +#ifdef INCLUDE_FS_TESTS + if ((outbuffer = malloc (PAGE_CACHE_SIZE*2)) == NULL) { + fprintf (stderr, _("Cannot allocate space for decompression buffer\n")); + exit(8); + } +#endif +} + /* Input status of 0 to print help and exit without an error. */ static void usage(int status) { @@ -464,6 +466,8 @@ int c; /* for getopt */ int start = 0; + init_statics(); + if (argc) progname = argv[0];