termux-packages/packages/nodejs/src-node_main.cc.patch
2022-03-12 07:59:50 +00:00

15 lines
615 B
Diff

diff '--color=auto' -uNr node-v17.7.1.orig/src/node_main.cc node-v17.7.1/src/node_main.cc
--- node-v17.7.1.orig/src/node_main.cc 2022-03-11 20:20:45.097755316 +0530
+++ node-v17.7.1/src/node_main.cc 2022-03-11 20:26:39.057755181 +0530
@@ -124,6 +124,10 @@
// calls elsewhere in the program (e.g., any logging from V8.)
setvbuf(stdout, nullptr, _IONBF, 0);
setvbuf(stderr, nullptr, _IONBF, 0);
+ if(getenv("TMPDIR") == NULL) {
+ // Give javascript programs (such as updated versions of npm) a working tmpdir.
+ putenv("TMPDIR=@TERMUX_PREFIX@/tmp");
+ }
return node::Start(argc, argv);
}
#endif