This is the mail archive of the libc-alpha@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]

[PATCH 2/2] Simplify tzfile fstat failure code


[BZ #21716]
* time/tzfile.c (__tzfile_read): Simplify slightly.
---
 ChangeLog     | 4 ++++
 time/tzfile.c | 5 +----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6f95da9ce2..1b768dc17a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2018-09-09  Paul Eggert  <eggert@cs.ucla.edu>
 
+	Simplify tzfile fstat failure code
+	[BZ #21716]
+	* time/tzfile.c (__tzfile_read): Simplify slightly.
+
 	Fix tzfile low-memory assertion failure
 	[BZ #21716]
 	* time/tzfile.c (__tzfile_read): Check for memory exhaustion
diff --git a/time/tzfile.c b/time/tzfile.c
index ea6e940303..72ef75f074 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -168,10 +168,7 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
 
   /* Get information about the file we are actually using.  */
   if (fstat64 (__fileno (f), &st) != 0)
-    {
-      fclose (f);
-      goto ret_free_transitions;
-    }
+    goto lose;
 
   free ((void *) transitions);
   transitions = NULL;
-- 
2.17.1


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