This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.25-281-g706256a


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  706256afb6c844a0e6aaab2b60f4326b91aca2e9 (commit)
      from  cd354a38495425bcf106fc410ec5e3c598c1aebe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=706256afb6c844a0e6aaab2b60f4326b91aca2e9

commit 706256afb6c844a0e6aaab2b60f4326b91aca2e9
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon May 8 14:32:58 2017 +0200

    support: Delete temporary files in LIFO order
    
    This is required to remove temporary directories which contain
    temporary files.  Previously, FIFO order meant that directory
    removal was attempted when the directory still contained files,
    which meant that temporary directory cleanup was essentially
    unsupported.

diff --git a/ChangeLog b/ChangeLog
index 4f09eec..603587b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2017-05-08  Florian Weimer  <fweimer@redhat.com>
 
+	Delete temporary files in LIFO order.
+	* support/temp_file.c (struct temp_name_list): Replace q member
+	with next.
+	(add_temp_file): Add new file to front of linked list.
+	(support_delete_temp_files): Use next member.
+	(support_print_temp_files): Likewise.
+
+2017-05-08  Florian Weimer  <fweimer@redhat.com>
+
 	* sysdeps/unix/sysv/linux/Makefile (sysdep_headers): Remove
 	sys/ultrasound.h.
 	* sysdeps/unix/sysv/linux/sys/ultrasound.h: Remove file.
diff --git a/support/temp_file.c b/support/temp_file.c
index 5950aec..50cbae6 100644
--- a/support/temp_file.c
+++ b/support/temp_file.c
@@ -25,7 +25,6 @@
 #include <support/support.h>
 
 #include <paths.h>
-#include <search.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -33,7 +32,7 @@
 /* List of temporary files.  */
 static struct temp_name_list
 {
-  struct qelem q;
+  struct temp_name_list *next;
   char *name;
 } *temp_name_list;
 
@@ -50,10 +49,8 @@ add_temp_file (const char *name)
   if (newname != NULL)
     {
       newp->name = newname;
-      if (temp_name_list == NULL)
-	temp_name_list = (struct temp_name_list *) &newp->q;
-      else
-	insque (newp, temp_name_list);
+      newp->next = temp_name_list;
+      temp_name_list = newp;
     }
   else
     free (newp);
@@ -105,8 +102,7 @@ support_delete_temp_files (void)
       (void) remove (temp_name_list->name);
       free (temp_name_list->name);
 
-      struct temp_name_list *next
-	= (struct temp_name_list *) temp_name_list->q.q_forw;
+      struct temp_name_list *next = temp_name_list->next;
       free (temp_name_list);
       temp_name_list = next;
     }
@@ -119,9 +115,7 @@ support_print_temp_files (FILE *f)
     {
       struct temp_name_list *n;
       fprintf (f, "temp_files=(\n");
-      for (n = temp_name_list;
-           n != NULL;
-           n = (struct temp_name_list *) n->q.q_forw)
+      for (n = temp_name_list; n != NULL; n = n->next)
         fprintf (f, "  '%s'\n", n->name);
       fprintf (f, ")\n");
     }

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |    9 +++++++++
 support/temp_file.c |   16 +++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]