mirror of
https://github.com/QingdaoU/Judger.git
synced 2024-12-27 23:41:42 +00:00
修复一处可变参数语法的误用
This commit is contained in:
parent
c2923381e3
commit
4abab494f7
@ -24,15 +24,10 @@
|
||||
#include "killer.h"
|
||||
|
||||
|
||||
void close_file(FILE *fp, ...) {
|
||||
va_list args;
|
||||
va_start(args, fp);
|
||||
|
||||
void close_file(FILE *fp) {
|
||||
if (fp != NULL) {
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7,7 +7,9 @@
|
||||
#define CHILD_ERROR_EXIT(error_code)\
|
||||
{\
|
||||
LOG_FATAL(log_fp, "Error: System errno: %s; Internal errno: "#error_code, strerror(errno)); \
|
||||
close_file(input_file, output_file, error_file); \
|
||||
close_file(input_file); \
|
||||
close_file(output_file); \
|
||||
close_file(error_file); \
|
||||
raise(SIGUSR1); \
|
||||
exit(EXIT_FAILURE); \
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user