Просмотр исходного кода

dpkg: Pass filenamenode instead of fileinlist to cu_installnew()

Guillem Jover лет назад: 14
Родитель
Сommit
6cfd1ce508
2 измененных файлов с 2 добавлено и 4 удалено
  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
    * if something goes wrong. Watch out for the CLEANUP comments to
    * 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

+ 1 - 3
src/cleanup.c

@@ -66,13 +66,11 @@ int cleanup_pkg_failed=0, cleanup_conflictor_failed=0;
  * look for it.
  */
 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;
 
   cleanup_pkg_failed++; cleanup_conflictor_failed++;
 
-  namenode= nifd->namenode;
   debug(dbg_eachfile,"cu_installnew `%s' flags=%o",namenode->name,namenode->flags);
 
   setupfnamevbs(namenode->name);