Kaynağa Gözat

dpkg: Switch remove_file_from_list() to tar_filenamenode_queue_pop()

The new function uses a namespaced function name, and is not based on
tarcontext, nor gets an unused tar_entry argument any more.
Guillem Jover 10 yıl önce
ebeveyn
işleme
91fc77d76c
1 değiştirilmiş dosya ile 11 ekleme ve 11 silme
  1. 11 11
      src/archives.c

+ 11 - 11
src/archives.c

@@ -129,6 +129,16 @@ tar_filenamenode_queue_push(struct filenamenode_queue *queue,
   return node;
 }
 
+static void
+tar_filenamenode_queue_pop(struct filenamenode_queue *queue,
+                           struct fileinlist **tail_prev,
+                           struct fileinlist *node)
+{
+  tar_pool_free(node);
+  *queue->tail = *tail_prev;
+  *tail_prev = NULL;
+}
+
 /**
  * Check if a file or directory will save a package from disappearance.
  *
@@ -609,16 +619,6 @@ struct fileinlist *addfiletolist(struct tarcontext *tc,
   return nifd;
 }
 
-static void
-remove_file_from_list(struct tarcontext *tc, struct tar_entry *ti,
-                      struct fileinlist **oldnifd,
-                      struct fileinlist *nifd)
-{
-  tar_pool_free(nifd);
-  *tc->newfiles_queue->tail = *oldnifd;
-  *oldnifd = NULL;
-}
-
 static bool
 linktosameexistingdir(const struct tar_entry *ti, const char *fname,
                       struct varbuf *symlinkfn)
@@ -937,7 +937,7 @@ tarobject(void *ctx, struct tar_entry *ti)
   if (keepexisting) {
     if (nifd->namenode->flags & fnnf_new_conff)
       nifd->namenode->flags |= fnnf_obs_conff;
-    remove_file_from_list(tc, ti, oldnifd, nifd);
+    tar_filenamenode_queue_pop(tc->newfiles_queue, oldnifd, nifd);
     tarobject_skip_entry(tc, ti);
     return 0;
   }