]> git.pld-linux.org Git - packages/util-linux.git/blob - util-linux-page.patch
- use functions
[packages/util-linux.git] / util-linux-page.patch
1 diff -ur util-linux-2.12q.org/disk-utils/fsck.cramfs.c util-linux-2.12q/disk-utils/fsck.cramfs.c
2 --- util-linux-2.12q.org/disk-utils/fsck.cramfs.c       2004-12-11 15:53:16.000000000 +0100
3 +++ util-linux-2.12q/disk-utils/fsck.cramfs.c   2005-02-27 20:03:09.000000000 +0100
4 @@ -77,15 +77,7 @@
5  #define PAD_SIZE 512
6  
7  #include <asm/page.h>
8 -#ifdef PAGE_SIZE
9  #define PAGE_CACHE_SIZE ((int) PAGE_SIZE)
10 -#elif defined __ia64__
11 -#define PAGE_CACHE_SIZE (16384)
12 -#elif defined __alpha__
13 -#define PAGE_CACHE_SIZE (8192)
14 -#else
15 -#define PAGE_CACHE_SIZE (4096)
16 -#endif
17  
18  /* Guarantee access to at least 8kB at a time */
19  #define ROMBUFFER_BITS 13
20 @@ -95,11 +87,21 @@
21  static unsigned long read_buffer_block = ~0UL;
22  
23  /* Uncompressing data structures... */
24 -static char outbuffer[PAGE_CACHE_SIZE*2];
25 +static char *outbuffer;
26  z_stream stream;
27  
28  #endif /* INCLUDE_FS_TESTS */
29  
30 +static void init_statics(void)
31 +{
32 +#ifdef INCLUDE_FS_TESTS
33 +       if ((outbuffer = malloc (PAGE_CACHE_SIZE*2)) == NULL) {
34 +               fprintf (stderr, _("Cannot allocate space for decompression buffer\n"));
35 +               exit(8);
36 +       }
37 +#endif
38 +}
39 +                   
40  /* Input status of 0 to print help and exit without an error. */
41  static void usage(int status)
42  {
43 @@ -464,6 +466,8 @@
44         int c;                  /* for getopt */
45         int start = 0;
46  
47 +       init_statics();
48 +
49         if (argc)
50                 progname = argv[0];
51  
This page took 0.212787 seconds and 3 git commands to generate.