Przeglądaj źródła

use do_fd_copy when extracting ar files

Wichert Akkerman 25 lat temu
rodzic
commit
f4f4a1aa8d
2 zmienionych plików z 6 dodań i 7 usunięć
  1. 4 0
      ChangeLog
  2. 2 7
      dpkg-deb/extract.c

+ 4 - 0
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>
 Thu Nov 30 02:45:42 CET 2000 Wichert Akkerman <wakkerma@debian.org>
 
 
   * scripts/dpkg-statoverride.{pl,8}: 
   * scripts/dpkg-statoverride.{pl,8}: 

+ 2 - 7
dpkg-deb/extract.c

@@ -245,13 +245,8 @@ void extracthalf(const char *debar, const char *directory,
     m_pipe(p1);
     m_pipe(p1);
     if (!(c1= m_fork())) {
     if (!(c1= m_fork())) {
       close(p1[0]);
       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);
       exit(0);
     }
     }
     close(p1[1]);
     close(p1[1]);