mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-11 08:48:16 +03:00
Use main() return value as exit code
This commit is contained in:
+1
-1
@@ -97,7 +97,7 @@ int vm_string_ref(struct string *s);
|
||||
int vm_copy_page(struct page *page);
|
||||
union vm_value vm_copy(union vm_value v, enum ain_data_type type);
|
||||
|
||||
void vm_execute_ain(struct ain *program);
|
||||
int vm_execute_ain(struct ain *program);
|
||||
void vm_call(int fno, int struct_page);
|
||||
int vm_time(void);
|
||||
|
||||
|
||||
+1
-2
@@ -352,6 +352,5 @@ int main(int argc, char *argv[])
|
||||
dbg_init();
|
||||
#endif
|
||||
|
||||
vm_execute_ain(ain);
|
||||
sys_exit(0);
|
||||
sys_exit(vm_execute_ain(ain));
|
||||
}
|
||||
|
||||
@@ -1581,7 +1581,7 @@ static void vm_execute(void)
|
||||
}
|
||||
}
|
||||
|
||||
void vm_execute_ain(struct ain *program)
|
||||
int vm_execute_ain(struct ain *program)
|
||||
{
|
||||
// initialize VM state
|
||||
stack_size = INITIAL_STACK_SIZE;
|
||||
@@ -1631,6 +1631,7 @@ void vm_execute_ain(struct ain *program)
|
||||
}
|
||||
|
||||
vm_call(ain->main, -1);
|
||||
return stack_pop().i;
|
||||
}
|
||||
|
||||
void vm_stack_trace(void)
|
||||
|
||||
Reference in New Issue
Block a user