diff options
author | ToadKing <toadking@toadking.com> | 2013-11-10 03:38:58 -0500 |
---|---|---|
committer | ToadKing <toadking@toadking.com> | 2013-11-10 03:38:58 -0500 |
commit | 1c7c811c8ded27a733075529f736797953a5209b (patch) | |
tree | 00292a7c293316cc7cbb097d9b1efdacd5bb4fa4 | |
parent | d446e2b3c3b96474106b9bd47f35d901abb14f6d (diff) |
nanosleep - don't write to rmtp if it's NULL
-rw-r--r-- | src/library.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/library.js b/src/library.js index 31f531e9..e08d63da 100644 --- a/src/library.js +++ b/src/library.js @@ -6131,8 +6131,10 @@ LibraryManager.library = { // int nanosleep(const struct timespec *rqtp, struct timespec *rmtp); var seconds = {{{ makeGetValue('rqtp', C_STRUCTS.timespec.tv_sec, 'i32') }}}; var nanoseconds = {{{ makeGetValue('rqtp', C_STRUCTS.timespec.tv_nsec, 'i32') }}}; - {{{ makeSetValue('rmtp', C_STRUCTS.timespec.tv_sec, '0', 'i32') }}} - {{{ makeSetValue('rmtp', C_STRUCTS.timespec.tv_nsec, '0', 'i32') }}} + if (rmtp !== 0) { + {{{ makeSetValue('rmtp', C_STRUCTS.timespec.tv_sec, '0', 'i32') }}} + {{{ makeSetValue('rmtp', C_STRUCTS.timespec.tv_nsec, '0', 'i32') }}} + } return _usleep((seconds * 1e6) + (nanoseconds / 1000)); }, // TODO: Implement these for real. |