From 4abab494f7e8a94eae32e8cfd71cfd3734dfaa92 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Wed, 18 Apr 2018 00:33:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=80=E5=A4=84=E5=8F=AF?= =?UTF-8?q?=E5=8F=98=E5=8F=82=E6=95=B0=E8=AF=AD=E6=B3=95=E7=9A=84=E8=AF=AF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/child.c | 7 +------ src/child.h | 4 +++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/child.c b/src/child.c index 8909e2d..9355aad 100644 --- a/src/child.c +++ b/src/child.c @@ -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); } diff --git a/src/child.h b/src/child.h index c01e6e7..4252412 100644 --- a/src/child.h +++ b/src/child.h @@ -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); \ }