Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -235,3 +235,4 @@ a license to everyone to use it as detailed in LICENSE.)
* Richard Cook <[email protected]> (copyright owned by Tableau Software, Inc.)
* Arnab Choudhury <[email protected]> (copyright owned by Tableau Software, Inc.)
* Charles Vaughn <[email protected]> (copyright owned by Tableau Software, Inc.)
* Pierre Krieger <[email protected]>
4 changes: 4 additions & 0 deletions src/library.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ LibraryManager.library = {
exit: function(status) {
__exit(status);
},
_Exit__deps: ['exit'],
_Exit: function(status) {
__exit(status);
},

_ZSt9terminatev__deps: ['exit'],
_ZSt9terminatev: function() {
Expand Down
10 changes: 8 additions & 2 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -7552,7 +7552,12 @@ def test_exit_status(self):
int main() {
atexit(cleanup); // this atexit should still be called
printf("hello, world!\n");
exit(118); // Unusual exit status to make sure it's working!
// Unusual exit status to make sure it's working!
if (CAPITAL_EXIT) {
_Exit(118);
} else {
exit(118);
}
}
'''
open('post.js', 'w').write('''
Expand All @@ -7562,7 +7567,8 @@ def test_exit_status(self):
Module.callMain();
''')
self.emcc_args += ['-s', 'INVOKE_RUN=0', '--post-js', 'post.js']
self.do_run(src, 'hello, world!\ncleanup\nI see exit status: 118')
self.do_run(src.replace('CAPITAL_EXIT', '0'), 'hello, world!\ncleanup\nI see exit status: 118')
self.do_run(src.replace('CAPITAL_EXIT', '1'), 'hello, world!\ncleanup\nI see exit status: 118')

def test_noexitruntime(self):
src = r'''
Expand Down