-+ long int r = random();
-+ if (asprintf(&path, "@TERMUX_PREFIX@/tmp/tmpfile.%d-%l", p, r) == -1) return NULL;
-+ int fd = open(path, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE);
++ unsigned int r = arc4random();
++ 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);