Bladeren bron

dpkg: Pass filenamenode instead of fileinlist to cu_installnew()

Guillem Jover 14 jaren geleden
bovenliggende
commit
6cfd1ce508
2 gewijzigde bestanden met toevoegingen van 2 en 4 verwijderingen
  1. 1 1
      src/archives.c
  2. 1 3
      src/cleanup.c

+ 1 - 1
src/archives.c

@@ -808,7 +808,7 @@ tarobject(void *ctx, struct tar_entry *ti)
   /* Now we start to do things that we need to be able to undo
   /* Now we start to do things that we need to be able to undo
    * if something goes wrong. Watch out for the CLEANUP comments to
    * if something goes wrong. Watch out for the CLEANUP comments to
    * keep an eye on what's installed on the disk at each point. */
    * keep an eye on what's installed on the disk at each point. */
-  push_cleanup(cu_installnew, ~ehflag_normaltidy, NULL, 0, 1, (void *)nifd);
+  push_cleanup(cu_installnew, ~ehflag_normaltidy, NULL, 0, 1, nifd->namenode);
 
 
   /*
   /*
    * CLEANUP: Now we either have the old file on the disk, or not, in
    * CLEANUP: Now we either have the old file on the disk, or not, in

+ 1 - 3
src/cleanup.c

@@ -66,13 +66,11 @@ int cleanup_pkg_failed=0, cleanup_conflictor_failed=0;
  * look for it.
  * look for it.
  */
  */
 void cu_installnew(int argc, void **argv) {
 void cu_installnew(int argc, void **argv) {
-  struct fileinlist *nifd= (struct fileinlist*)argv[0];
-  struct filenamenode *namenode;
+  struct filenamenode *namenode = argv[0];
   struct stat stab;
   struct stat stab;
 
 
   cleanup_pkg_failed++; cleanup_conflictor_failed++;
   cleanup_pkg_failed++; cleanup_conflictor_failed++;
 
 
-  namenode= nifd->namenode;
   debug(dbg_eachfile,"cu_installnew `%s' flags=%o",namenode->name,namenode->flags);
   debug(dbg_eachfile,"cu_installnew `%s' flags=%o",namenode->name,namenode->flags);
 
 
   setupfnamevbs(namenode->name);
   setupfnamevbs(namenode->name);