wok rev 3320
Up: module-init-tools (3.9)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jun 08 19:12:04 2009 +0200 (2009-06-08) |
parents | c29319d0340a |
children | 65c73b684987 |
files | module-init-tools/receipt module-init-tools/stuff/lzlib.u |
line diff
1.1 --- a/module-init-tools/receipt Mon Jun 08 16:39:21 2009 +0200 1.2 +++ b/module-init-tools/receipt Mon Jun 08 19:12:04 2009 +0200 1.3 @@ -1,7 +1,7 @@ 1.4 # SliTaz package receipt. 1.5 1.6 PACKAGE="module-init-tools" 1.7 -VERSION="3.2" 1.8 +VERSION="3.9" 1.9 CATEGORY="base-system" 1.10 SHORT_DESC="Kernel modules manipulation tools." 1.11 MAINTAINER="pascal.bellard@slitaz.org"
2.1 --- a/module-init-tools/stuff/lzlib.u Mon Jun 08 16:39:21 2009 +0200 2.2 +++ b/module-init-tools/stuff/lzlib.u Mon Jun 08 19:12:04 2009 +0200 2.3 @@ -1,47 +1,45 @@ 2.4 ---- module-init-tools-3.2/zlibsupport.c 2.5 -+++ module-init-tools-3.2/zlibsupport.c 2.6 -@@ -16,58 +16,33 @@ 2.7 +--- module-init-tools-3.9/zlibsupport.c 2.8 ++++ module-init-tools-3.9/zlibsupport.c 2.9 +@@ -18,60 +18,40 @@ 2.10 #include "testing.h" 2.11 2.12 #ifdef CONFIG_USE_ZLIB 2.13 -#include <zlib.h> 2.14 -+#include <lzlib.h> 2.15 - 2.16 +- 2.17 -void *grab_contents(gzFile *gzfd, unsigned long *size) 2.18 -{ 2.19 - unsigned int max = 16384; 2.20 -- void *buffer = malloc(max); 2.21 +- void *buffer = NOFAIL(malloc(max)); 2.22 - int ret; 2.23 - 2.24 -- if (!buffer) 2.25 -- return NULL; 2.26 -- 2.27 - *size = 0; 2.28 - while ((ret = gzread(gzfd, buffer + *size, max - *size)) > 0) { 2.29 - *size += ret; 2.30 -- if (*size == max) { 2.31 -- buffer = realloc(buffer, max *= 2); 2.32 -- if (!buffer) 2.33 -- return NULL; 2.34 -- } 2.35 +- if (*size == max) 2.36 +- buffer = NOFAIL(realloc(buffer, max *= 2)); 2.37 - } 2.38 - if (ret < 0) { 2.39 - free(buffer); 2.40 - buffer = NULL; 2.41 - } 2.42 +- 2.43 - return buffer; 2.44 -} 2.45 -- 2.46 ++#include <lzlib.h> 2.47 + 2.48 void *grab_fd(int fd, unsigned long *size) 2.49 { 2.50 - gzFile gzfd; 2.51 + lzFile lzfd; 2.52 2.53 - gzfd = gzdopen(fd, "rb"); 2.54 -- if (!gzfd) 2.55 +- if (!gzfd) { 2.56 + lzfd = lzdopen(fd, "rb"); 2.57 -+ if (!lzfd) 2.58 ++ if (!lzfd) { 2.59 + if (errno == ENOMEM) 2.60 + fatal("Memory allocation failure in gzdopen\n"); 2.61 return NULL; 2.62 + } 2.63 2.64 - /* gzclose(gzfd) would close fd, which would drop locks. 2.65 + /* lzclose(lzfd) would close fd, which would drop locks. 2.66 @@ -58,11 +56,15 @@ 2.67 + lzFile lzfd; 2.68 void *buffer; 2.69 2.70 + errno = 0; 2.71 - gzfd = gzopen(filename, "rb"); 2.72 -- if (!gzfd) 2.73 +- if (!gzfd) { 2.74 + lzfd = lzopen(filename, "rb"); 2.75 -+ if (!lzfd) 2.76 ++ if (!lzfd) { 2.77 + if (errno == ENOMEM) 2.78 + fatal("Memory allocation failure in gzopen\n"); 2.79 return NULL; 2.80 + } 2.81 - buffer = grab_contents(gzfd, size); 2.82 - gzclose(gzfd); 2.83 + buffer = lzgrab(lzfd, size); 2.84 @@ -70,14 +72,24 @@ 2.85 return buffer; 2.86 } 2.87 2.88 ---- module-init-tools-3.2/configure 2.89 -+++ module-init-tools-3.2/configure 2.90 -@@ -1741,7 +1741,7 @@ 2.91 + 2.92 +--- module-init-tools-3.9/configure 2.93 ++++ module-init-tools-3.9/configure 2.94 +@@ -2590,7 +2590,7 @@ 2.95 #define CONFIG_USE_ZLIB 1 2.96 _ACEOF 2.97 2.98 - zlib_flags="-Wl,-Bstatic -lz -Wl,-Bdynamic" 2.99 + zlib_flags="-Wl,-Bdynamic -lz -llz" 2.100 fi 2.101 - fi; 2.102 + fi 2.103 2.104 +@@ -2602,7 +2602,7 @@ 2.105 + #define CONFIG_USE_ZLIB 1 2.106 + _ACEOF 2.107 + 2.108 +- zlib_flags="-lz" 2.109 ++ zlib_flags="-lz -llz" 2.110 + fi 2.111 + fi 2.112 +