ndk-patches: Use @TERMUX_PREFIX@

This commit is contained in:
Fredrik Fornwall 2017-07-07 03:29:49 +02:00
parent 8340bbe70a
commit fd11c5fbfa
1 changed files with 1 additions and 1 deletions

View File

@ -65,7 +65,7 @@ diff -u -r /home/fornwall/lib/android-ndk/sysroot/usr/include/stdio.h ./usr/incl
+ int i;
+ for (i = 0; i < 100; i++) {
+ unsigned int r = arc4random();
+ if (asprintf(&path, "/data/data/com.termux/files/usr/tmp/tmpfile.%d-%u", p, r) == -1) return NULL;
+ if (asprintf(&path, "@TERMUX_PREFIX@/tmp/tmpfile.%d-%u", p, r) == -1) return NULL;
+ int fd = open(path, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE, 0600);
+ free(path);
+ if (fd >= 0) {