lighttpd: Work around cyanogenmod dlopen problem
authorFredrik Fornwall <fredrik@fornwall.net>
Tue, 19 Jan 2016 22:47:48 +0000 (17:47 -0500)
committerFredrik Fornwall <fredrik@fornwall.net>
Tue, 19 Jan 2016 22:47:48 +0000 (17:47 -0500)
This hopefully fixes #122.

packages/lighttpd/build.sh
packages/lighttpd/src-plugin.c.patch [new file with mode: 0644]

index f8b8597..76675d1 100644 (file)
@@ -1,6 +1,7 @@
 TERMUX_PKG_HOMEPAGE=http://www.lighttpd.net
 TERMUX_PKG_DESCRIPTION="Web server optimized for speed-critical environments while remaining standards-compliant, secure and flexible"
 TERMUX_PKG_VERSION=1.4.39
+TERMUX_PKG_BUILD_REVISION=1
 TERMUX_PKG_SRCURL=http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${TERMUX_PKG_VERSION}.tar.xz
 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--with-bzip2 --with-openssl --with-pcre --with-zlib"
 TERMUX_PKG_DEPENDS="libbz2, openssl, pcre"
diff --git a/packages/lighttpd/src-plugin.c.patch b/packages/lighttpd/src-plugin.c.patch
new file mode 100644 (file)
index 0000000..3b81a92
--- /dev/null
@@ -0,0 +1,16 @@
+diff -u -r ../lighttpd-1.4.39/src/plugin.c ./src/plugin.c
+--- ../lighttpd-1.4.39/src/plugin.c    2015-11-22 13:59:02.000000000 -0500
++++ ./src/plugin.c     2016-01-19 17:43:51.306199574 -0500
+@@ -259,7 +259,11 @@
+ #else
+               *(void **)(&init) = dlsym(p->lib, srv->tmp_buf->ptr);
+ #endif
+-              if ((error = dlerror()) != NULL)  {
++              /* Do not call dlerror() when dlsym() has found a handle, since there may have
++                 been a (recoverable) error during loading of the shared library. This seems
++                 to happen on (some?) cyanogenmod devices trying to dlopen("libvendorconn.so")
++                 from NetdClient.cpp and failing due to no such file. */
++              if (init == NULL && (error = dlerror()) != NULL)  {
+                       log_error_write(srv, __FILE__, __LINE__, "s", error);
+                       plugin_free(p);