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.
This commit is contained in:
parent
cf96a69490
commit
4713f0c89d
4 changed files with 13 additions and 7 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue