chiark / gitweb /
6c43c5224f3ea566111dbeea0d56d824101f0813
[termux-packages] / packages / nodejs / src-node_main.cc.patch
1 diff -u -r ../node-v6.0.0/src/node_main.cc ./src/node_main.cc
2 --- ../node-v6.0.0/src/node_main.cc     2016-04-26 15:50:22.000000000 -0400
3 +++ ./src/node_main.cc  2016-05-02 16:29:08.313594254 -0400
4 @@ -1,4 +1,5 @@
5  #include "node.h"
6 +#include <stdlib.h>
7  
8  #ifdef _WIN32
9  #include <VersionHelpers.h>
10 @@ -50,6 +51,11 @@
11  // UNIX
12  int main(int argc, char *argv[]) {
13    setvbuf(stderr, NULL, _IOLBF, 1024);
14 +  if (getenv("TMPDIR") == NULL) {
15 +    /* Give javascript programs (such as updated versions of npm) a working tmpdir. */
16 +    putenv("TMPDIR=@TERMUX_PREFIX@/tmp");
17 +  }
18 +
19    return node::Start(argc, argv);
20  }
21  #endif