Skip to content

Commit

Permalink
daemonize: Use $PREFIX instead of /
Browse files Browse the repository at this point in the history
As / is no longer readable on Android 7, we switch to chdir($PREFIX)
instead of chdir(/) to get a readable directory.

Fixes #614.
  • Loading branch information
fornwall committed Dec 23, 2016
1 parent 9247ce4 commit c6c2957
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/daemonize/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
TERMUX_PKG_HOMEPAGE=http://software.clapper.org/daemonize/
TERMUX_PKG_DESCRIPTION="Run a command as a Unix daemon"
TERMUX_PKG_VERSION=1.7.7
TERMUX_PKG_BUILD_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/bmc/daemonize/archive/release-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=b3cafea3244ed5015a3691456644386fc438102adbdc305af553928a185bea05
TERMUX_PKG_FOLDERNAME=daemonize-release-$TERMUX_PKG_VERSION
Expand Down
15 changes: 15 additions & 0 deletions packages/daemonize/daemonize.c.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff -u -r ../daemonize-release-1.7.7/daemonize.c ./daemonize.c
--- ../daemonize-release-1.7.7/daemonize.c 2015-12-11 17:54:43.000000000 -0500
+++ ./daemonize.c 2016-12-23 03:40:30.055592421 -0500
@@ -38,7 +38,10 @@
static bool be_verbose = FALSE;
static const char *user = NULL;
static char **cmd = NULL;
-static const char *cwd = "/";
+/* Termux patch: Use a readable directory for e.g. runsvdir to work,
+ as / is not readable starting from Android 7:
+ https://github.com/termux/termux-packages/issues/614 */
+static const char *cwd = "@TERMUX_PREFIX@";
static int null_fd = -1;
static int out_fd = -1;
static int err_fd = -1;

0 comments on commit c6c2957

Please sign in to comment.