diff options
-rwxr-xr-x | emcc | 1 | ||||
-rw-r--r-- | src/library.js | 13 |
2 files changed, 9 insertions, 5 deletions
@@ -1136,6 +1136,7 @@ try: if shared.Settings.MAIN_MODULE or shared.Settings.SIDE_MODULE: assert not memory_init_file, 'memory init file is not supported with module linking' + assert shared.Settings.ASM_JS, 'module linking requires asm.js output (-s ASM_JS=1)' shared.Settings.LINKABLE = 1 # TODO: add FORCE_DCE option for the brave people that do want to dce here and in side modules debug_level = max(debug_level, 2) diff --git a/src/library.js b/src/library.js index 02981a80..3e69cc08 100644 --- a/src/library.js +++ b/src/library.js @@ -459,14 +459,17 @@ LibraryManager.library = { // http://pubs.opengroup.org/onlinepubs/009695399/functions/creat.html return _open(path, {{{ cDefine('O_WRONLY') }}} | {{{ cDefine('O_CREAT') }}} | {{{ cDefine('O_TRUNC') }}}, allocate([mode, 0, 0, 0], 'i32', ALLOC_STACK)); }, - mkstemp__deps: ['creat'], - mkstemp: function(template) { - if (!_mkstemp.counter) _mkstemp.counter = 0; - var c = (_mkstemp.counter++).toString(); + mktemp: function(template) { + if (!_mktemp.counter) _mktemp.counter = 0; + var c = (_mktemp.counter++).toString(); var rep = 'XXXXXX'; while (c.length < rep.length) c = '0' + c; writeArrayToMemory(intArrayFromString(c), template + Pointer_stringify(template).indexOf(rep)); - return _creat(template, 0600); + return template; + }, + mkstemp__deps: ['creat', 'mktemp'], + mkstemp: function(template) { + return _creat(_mktemp(template), 0600); }, fcntl__deps: ['$FS', '__setErrNo', '$ERRNO_CODES'], fcntl: function(fildes, cmd, varargs, dup2) { |