86b3c4bf727688ecb7654c46e1f0b50abbe119ae
[termux-packages] / packages / proot / src-path-temp.c.patch
1 diff -u -r ../PRoot-5.1.0/src/path/temp.c ./src/path/temp.c
2 --- ../PRoot-5.1.0/src/path/temp.c 2014-12-15 09:18:11.000000000 -0500
3 +++ ./src/path/temp.c 2016-01-08 19:40:46.901462550 -0500
4 @@ -120,9 +120,14 @@
5 {
6 int result;
7 int status;
8 - char *cwd;
9
10 +#ifdef __ANDROID__
11 + char cwd[PATH_MAX];
12 + getcwd(cwd, PATH_MAX);
13 +#else
14 + char *cwd;
15 cwd = get_current_dir_name();
16 +#endif
17
18 status = chmod(path, 0700);
19 if (status < 0) {
20 @@ -163,7 +168,9 @@
21 result = -1;
22 note(NULL, ERROR, SYSTEM, "can't chdir to '%s'", cwd);
23 }
24 +#ifndef __ANDROID__
25 free(cwd);
26 +#endif
27 }
28
29 return result;