修复一处可变参数语法的误用

This commit is contained in:
virusdefender 2018-04-18 00:33:12 +08:00
parent c2923381e3
commit 4abab494f7
2 changed files with 4 additions and 7 deletions

View File

@ -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);
}

View File

@ -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); \
}