Ignore SIGTERM prior to gz_close()
authorGlenn L McGrath <bug1@ihug.co.nz>
Sat, 7 Apr 2001 02:40:59 +0000 (02:40 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Sat, 7 Apr 2001 02:40:59 +0000 (02:40 -0000)
archival/dpkg_deb.c
dpkg_deb.c

index 309f8d7628c2809c57afa449105427b3120c5aa0..8239c3c43a618291fbd00957c92394859a8ac386 100644 (file)
@@ -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 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen
        }
        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;
index 309f8d7628c2809c57afa449105427b3120c5aa0..8239c3c43a618291fbd00957c92394859a8ac386 100644 (file)
@@ -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 @@ extern int deb_extract(int optflags, const char *dir_name, const char *deb_filen
        }
        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;