]> err.no Git - dpkg/commitdiff
use do_fd_copy when extracting ar files
authorWichert Akkerman <wakkerma@debian.org>
Sun, 3 Dec 2000 21:12:58 +0000 (21:12 +0000)
committerWichert Akkerman <wakkerma@debian.org>
Sun, 3 Dec 2000 21:12:58 +0000 (21:12 +0000)
ChangeLog
dpkg-deb/extract.c

index 25dbbab9484c20068e05aee5f3af62fa201a0ebb..b8e798a5992529a0031836b2f7278727130cdf90 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Sun Dec  3 22:11:22 CET 2000 Wichert Akkerman <wakkerma@debian.org>
+
+  * dpkg-deb/extract.c: apply one of Adams do_fd_copy patches
+
 Thu Nov 30 02:45:42 CET 2000 Wichert Akkerman <wakkerma@debian.org>
 
   * scripts/dpkg-statoverride.{pl,8}: 
index 13992a8a18f2b1f2bdd349e14049b44b1259408a..dc4e072cee1c8a1c2496e5731e57a50247724e5f 100644 (file)
@@ -245,13 +245,8 @@ void extracthalf(const char *debar, const char *directory,
     m_pipe(p1);
     if (!(c1= m_fork())) {
       close(p1[0]);
-      if (!(pi= fdopen(p1[1],"w"))) ohshite(_("failed to fdopen p1 in copy"));
-      while (memberlen > 0) {
-        if ((c= getc(ar)) == EOF) readfail(ar,debar,_("member data"));
-        if (putc(c,pi) == EOF) ohshite(_("failed to write to pipe in copy"));
-        memberlen--;
-      }
-      if (fclose(pi) == EOF) ohshite(_("failed to close pipe in copy"));
+      do_fd_copy(fileno(ar), p1[1], memberlen, _("failed to write to pipe in copy"));
+      if (close(p1[1]) == EOF) ohshite(_("failed to close pipe in copy"));
       exit(0);
     }
     close(p1[1]);