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