diff options
author | Joey Hess <joey@kitenet.net> | 2013-05-23 13:54:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-05-23 13:54:49 -0400 |
commit | 93e8893cf37080306ec522d389f7e4ecceb84355 (patch) | |
tree | 03151b380232a0b41943723b671857b7b9f48d6d /standalone/android/start.c | |
parent | 90cc410cfbc9f94aeda702b44e49d0169cce75a5 (diff) |
Android app: Avoid using hard links to app's lib directory, which is sometimes on a different filesystem than the data directory.
Assumes symlinks work on all android. If not, this would need to be adapted
to try both. This worked for me.
Diffstat (limited to 'standalone/android/start.c')
-rw-r--r-- | standalone/android/start.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/standalone/android/start.c b/standalone/android/start.c index d49a086c7..c67c5da0c 100644 --- a/standalone/android/start.c +++ b/standalone/android/start.c @@ -47,11 +47,15 @@ main () { } } - /* If this is the first run, set up busybox link. */ + /* If this is the first run, set up busybox symlink, + * which allows busybox to run. */ if (stat("busybox", &st_buf) != 0) { - if (link("lib/lib.busybox.so", "busybox") != 0) { - perror("link busybox"); - exit(1); + if (symlink("lib/lib.busybox.so", "busybox") != 0) { + /* Just in case! */ + if (link("lib/lib.busybox.so", "busybox") != 0) { + perror("link busybox"); + exit(1); + } } } |