修复部分typo并增加了Python binding中的部分常量

This commit is contained in:
LiYang 2016-10-13 22:26:51 +08:00
parent f1b02a0361
commit c2520c9c1f
3 changed files with 14 additions and 2 deletions

View File

@ -135,4 +135,16 @@ PyMODINIT_FUNC init_judger(void) {
PyModule_AddIntConstant(module, "RESULT_MEMORY_LIMIT_EXCEEDED", MEMORY_LIMIT_EXCEEDED);
PyModule_AddIntConstant(module, "RESULT_RUNTIME_ERROR", RUNTIME_ERROR);
PyModule_AddIntConstant(module, "RESULT_SYSTEM_ERROR", SYSTEM_ERROR);
PyModule_AddIntConstant(module, "ERROR_INVALID_CONFIG", INVALID_CONFIG);
PyModule_AddIntConstant(module, "ERROR_FORK_FAILED", FORK_FAILED);
PyModule_AddIntConstant(module, "ERROR_PTHREAD_FAILED", PTHREAD_FAILED);
PyModule_AddIntConstant(module, "ERROR_WAIT_FAILED", WAIT_FAILED);
PyModule_AddIntConstant(module, "ERROR_ROOT_REQUIRED", ROOT_REQUIRED);
PyModule_AddIntConstant(module, "ERROR_LOAD_SECCOMP_FAILED", LOAD_SECCOMP_FAILED);
PyModule_AddIntConstant(module, "ERROR_SETRLIMIT_FAILED", SETRLIMIT_FAILED);
PyModule_AddIntConstant(module, "ERROR_DUP2_FAILED", DUP2_FAILED);
PyModule_AddIntConstant(module, "ERROR_SETUID_FAILED", SETUID_FAILED);
PyModule_AddIntConstant(module, "ERROR_EXECVE_FAILED", EXECVE_FAILED);
PyModule_AddIntConstant(module, "ERROR_SPJ_ERROR", SPJ_ERROR);
}

View File

@ -56,7 +56,7 @@ void run(struct config *_config, struct result *_result) {
// pid < 0 shows clone failed
if (child_pid < 0) {
ERROR_EXIT(CLONE_FAILED);
ERROR_EXIT(FORK_FAILED);
}
else if (child_pid == 0) {
child_process(log_fp, _config);

View File

@ -23,7 +23,7 @@
enum {
SUCCESS = 0,
INVALID_CONFIG = -1,
CLONE_FAILED = -2,
FORK_FAILED = -2,
PTHREAD_FAILED = -3,
WAIT_FAILED = -4,
ROOT_REQUIRED = -5,