Ignore SIGTERM prior to gz_close()
diff --git a/dpkg_deb.c b/dpkg_deb.c
index 309f8d7..8239c3c 100644
--- a/dpkg_deb.c
+++ b/dpkg_deb.c
@@ -24,6 +24,7 @@
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
+#include <signal.h>
#include "busybox.h"
/* From gunzip.c */
@@ -120,8 +121,11 @@
}
status = readTarFile(srcFd, extract_flag, list_flag,
extract_to_stdout, verbose_flag, NULL, extract_list);
- close(srcFd);
+
+ /* we are deliberately terminating the child so we can safely ignore this */
+ signal(SIGTERM, SIG_IGN);
gz_close(pid);
+ close(srcFd);
fclose(comp_file);
return status;