mirror of
https://github.com/QingdaoU/Judger.git
synced 2024-12-27 23:41:42 +00:00
when child process calls CHILD_ERROR_EXIT, it should kill itself
This commit is contained in:
parent
cc1fc4a3e2
commit
e9952f428b
@ -36,7 +36,7 @@ void close_file(FILE *fp, ...) {
|
||||
}
|
||||
|
||||
|
||||
int child_process(FILE *log_fp, struct config *_config) {
|
||||
void child_process(FILE *log_fp, struct config *_config) {
|
||||
FILE *input_file = NULL, *output_file = NULL, *error_file = NULL;
|
||||
|
||||
if (_config->max_stack != UNLIMITED) {
|
||||
@ -159,5 +159,4 @@ int child_process(FILE *log_fp, struct config *_config) {
|
||||
|
||||
execve(_config->exe_path, _config->args, _config->env);
|
||||
CHILD_ERROR_EXIT(EXECVE_FAILED);
|
||||
return 0;
|
||||
}
|
||||
|
@ -9,10 +9,10 @@
|
||||
LOG_FATAL(log_fp, "Error: System errno: %s; Internal errno: "#error_code, strerror(errno)); \
|
||||
close_file(input_file, output_file, error_file); \
|
||||
raise(SIGUSR1); \
|
||||
return -1; \
|
||||
exit(EXIT_FAILURE); \
|
||||
}
|
||||
|
||||
|
||||
int child_process(FILE *log_fp, struct config *_config);
|
||||
void child_process(FILE *log_fp, struct config *_config);
|
||||
|
||||
#endif //JUDGER_CHILD_H
|
||||
|
Loading…
Reference in New Issue
Block a user