| 1 | Without this patch functions such as process.getgroups |
| 2 | are not built on Android, which breaks things such as |
| 3 | npm/node_modules/which/which.js. |
| 4 | |
| 5 | diff -u -r ../node-v4.0.0/src/node.cc ./src/node.cc |
| 6 | --- ../node-v4.0.0/src/node.cc 2015-09-08 11:30:45.000000000 -0400 |
| 7 | +++ ./src/node.cc 2015-09-08 19:06:39.415724588 -0400 |
| 8 | @@ -69,7 +69,7 @@ |
| 9 | #include <unistd.h> // setuid, getuid |
| 10 | #endif |
| 11 | |
| 12 | -#if defined(__POSIX__) && !defined(__ANDROID__) |
| 13 | +#if defined(__POSIX__) |
| 14 | #include <pwd.h> // getpwnam() |
| 15 | #include <grp.h> // getgrnam() |
| 16 | #endif |
| 17 | @@ -1590,7 +1590,7 @@ |
| 18 | } |
| 19 | |
| 20 | |
| 21 | -#if defined(__POSIX__) && !defined(__ANDROID__) |
| 22 | +#if defined(__POSIX__) |
| 23 | |
| 24 | static const uid_t uid_not_found = static_cast<uid_t>(-1); |
| 25 | static const gid_t gid_not_found = static_cast<gid_t>(-1); |
| 26 | @@ -1910,7 +1910,7 @@ |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | -#endif // __POSIX__ && !defined(__ANDROID__) |
| 31 | +#endif // __POSIX__ |
| 32 | |
| 33 | |
| 34 | void Exit(const FunctionCallbackInfo<Value>& args) { |
| 35 | @@ -2866,7 +2866,7 @@ |
| 36 | |
| 37 | env->SetMethod(process, "umask", Umask); |
| 38 | |
| 39 | -#if defined(__POSIX__) && !defined(__ANDROID__) |
| 40 | +#if defined(__POSIX__) |
| 41 | env->SetMethod(process, "getuid", GetUid); |
| 42 | env->SetMethod(process, "geteuid", GetEUid); |
| 43 | env->SetMethod(process, "setuid", SetUid); |
| 44 | @@ -2880,7 +2880,7 @@ |
| 45 | env->SetMethod(process, "getgroups", GetGroups); |
| 46 | env->SetMethod(process, "setgroups", SetGroups); |
| 47 | env->SetMethod(process, "initgroups", InitGroups); |
| 48 | -#endif // __POSIX__ && !defined(__ANDROID__) |
| 49 | +#endif // __POSIX__ |
| 50 | |
| 51 | env->SetMethod(process, "_kill", Kill); |
| 52 | |