Skip to content

Commit

Permalink
Fix 'make module'
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanson committed Sep 18, 2024
1 parent 8c4ca85 commit 3501c65
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion tests/ckb_js_tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ all: \
syscall \
fs_bytecode\
simple_udt\
fs_mount
fs_mount \
module

cargo_test:
cargo test
Expand Down
20 changes: 12 additions & 8 deletions tests/ckb_js_tests/test_data/spawn_caller.c
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
#include "ckb_syscalls.h"

int main() {
int err = 0;
const char *argv[] = {"-f"};
int8_t spawn_exit_code = -1;
uint64_t pid = 0;
uint64_t inherited_fds[1] = {0};
int8_t exit_code = 0;
spawn_args_t spgs = {
.memory_limit = 8,
.exit_code = &spawn_exit_code,
.content = NULL,
.content_length = NULL,
.argc = 1,
.argv = argv,
.process_id = &pid,
.inherited_fds = inherited_fds,
};
int success = ckb_spawn(1, 3, 0, 1, argv, &spgs);
if (success != 0) {
err = ckb_spawn(1, CKB_SOURCE_CELL_DEP, 0, 0, &spgs);
if (err != 0) {
return 1;
}
if (spawn_exit_code != 0) {
err = ckb_wait(pid, &exit_code);
if (err != 0) {
return 1;
}
return 0;
Expand Down

0 comments on commit 3501c65

Please sign in to comment.