wok-6.x rev 15780
busybox: fix unmappable insmod
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Jan 13 00:00:03 2014 +0100 (2014-01-13) |
parents | ad05e742684d |
children | de8cd706512c |
files | busybox/receipt busybox/stuff/busybox-1.22-insmod.u |
line diff
1.1 --- a/busybox/receipt Sat Jan 11 11:04:09 2014 +0000 1.2 +++ b/busybox/receipt Mon Jan 13 00:00:03 2014 +0100 1.3 @@ -43,6 +43,7 @@ 1.4 diff.u 1.5 diet.u 1.6 losetup.u 1.7 +insmod.u 1.8 EOT 1.9 cp $stuff/$PACKAGE-${VERSION%.*}.config .config 1.10 }
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/busybox/stuff/busybox-1.22-insmod.u Mon Jan 13 00:00:03 2014 +0100 2.3 @@ -0,0 +1,15 @@ 2.4 +--- busybox-1.22.0/modutils/modutils.c 2.5 ++++ busybox-1.22.0/modutils/modutils.c 2.6 +@@ -160,7 +160,11 @@ 2.7 + mmaped = 1; 2.8 + } else { 2.9 + errno = ENOMEM; /* may be changed by e.g. open errors below */ 2.10 +- image = xmalloc_open_zipped_read_close(filename, &image_size); 2.11 ++ image = xmalloc_open_read_close(filename, &image_size); 2.12 ++ if (image && image_size >= 4 && strncmp(image+1,"ELF",3)) { 2.13 ++ free(image); 2.14 ++ image = xmalloc_open_zipped_read_close(filename, &image_size); 2.15 ++ } 2.16 + if (!image) 2.17 + return -errno; 2.18 + }