[source] opkg: use vfork on gz_open by default (FS#120)

LEDE Commits lede-commits at lists.infradead.org
Sun Aug 28 05:19:39 PDT 2016


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/763f5d787316ec1b041450a644ecd9416f11e94f

commit 763f5d787316ec1b041450a644ecd9416f11e94f
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Sun Aug 28 14:18:14 2016 +0200

    opkg: use vfork on gz_open by default (FS#120)
    
    Reduces memory consumption and binary size
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 package/system/opkg/patches/280-use-vfork.patch | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/package/system/opkg/patches/280-use-vfork.patch b/package/system/opkg/patches/280-use-vfork.patch
new file mode 100644
index 0000000..1c46f52
--- /dev/null
+++ b/package/system/opkg/patches/280-use-vfork.patch
@@ -0,0 +1,20 @@
+--- a/libbb/gz_open.c
++++ b/libbb/gz_open.c
+@@ -29,7 +29,7 @@
+ #include <unistd.h>
+ #include "libbb.h"
+ 
+-static int gz_use_vfork;
++static const int gz_use_vfork = 1;
+ 
+ FILE *
+ gz_open(FILE *compressed_file, int *pid)
+@@ -38,8 +38,6 @@ gz_open(FILE *compressed_file, int *pid)
+ 	off_t floc;
+ 	int cfile = -1;
+ 
+-	gz_use_vfork = (getenv("OPKG_USE_VFORK") != NULL);
+-
+ 	if (gz_use_vfork) {
+ 		/* Create a new file descriptor for the input stream
+ 		 * (it *must* be associated with a file), and lseek()



More information about the lede-commits mailing list