termux-packages/packages/nodejs/src-node.cc.patch
Fredrik Fornwall b1a9c9c562 nodejs: Just keep a single current package
Drop the LTS version of node.js for now and keep only a single current
node package.
2018-09-11 23:51:55 +02:00

38 lines
1.5 KiB
Diff

diff -u -r ../node-v10.9.0/src/node.cc ./src/node.cc
--- ../node-v10.9.0/src/node.cc 2018-08-15 13:53:34.000000000 +0000
+++ ./src/node.cc 2018-08-23 20:49:59.353995878 +0000
@@ -106,7 +106,7 @@
#include <unistd.h> // setuid, getuid
#endif
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
+#if defined(__POSIX__) && !defined(__CloudABI__)
#include <pwd.h> // getpwnam()
#include <grp.h> // getgrnam()
#endif
@@ -690,7 +690,7 @@
// Look up environment variable unless running as setuid root.
bool SafeGetenv(const char* key, std::string* text) {
-#if !defined(__CloudABI__) && !defined(_WIN32)
+#if !defined(__CloudABI__) && !defined(_WIN32) && !defined(__ANDROID__)
if (linux_at_secure || getuid() != geteuid() || getgid() != getegid())
goto fail;
#endif
@@ -2402,13 +2402,13 @@
env->SetMethod(process, "reallyExit", Exit);
env->SetMethodNoSideEffect(process, "uptime", Uptime);
-#if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__)
+#if defined(__POSIX__) && !defined(__CloudABI__)
env->SetMethodNoSideEffect(process, "getuid", GetUid);
env->SetMethodNoSideEffect(process, "geteuid", GetEUid);
env->SetMethodNoSideEffect(process, "getgid", GetGid);
env->SetMethodNoSideEffect(process, "getegid", GetEGid);
env->SetMethodNoSideEffect(process, "getgroups", GetGroups);
-#endif // __POSIX__ && !defined(__ANDROID__) && !defined(__CloudABI__)
+#endif // __POSIX__ && !defined(__CloudABI__)
}