[RFA 07/23] Remove make_cleanup_fclose

Tom Tromey
2017-05-03T22:46:37Z

After the preceding patches, make_cleanup_fclose is no longer used, so
remove it.

2017-05-02 Tom Tromey <tom@tromey.com>

* utils.h (make_cleanup_fclose): Remove.
* utils.c (do_fclose_cleanup, make_cleanup_fclose): Remove.
---
gdb/ChangeLog | 5 +++++
gdb/utils.c | 18 ------------------
gdb/utils.h | 2 --
3 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1dad15be..2f1219f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2017-05-02 Tom Tromey <tom@tromey.com>

+ * utils.h (make_cleanup_fclose): Remove.
+ * utils.c (do_fclose_cleanup, make_cleanup_fclose): Remove.
+
+2017-05-02 Tom Tromey <tom@tromey.com>
+
* top.c (open_terminal_stream): Return gdb_file_up.
(new_ui_command): Update.

diff --git a/gdb/utils.c b/gdb/utils.c
index b4332f8..bffce78 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -151,24 +151,6 @@ make_cleanup_freeargv (char **arg)
return make_cleanup (do_freeargv, arg);
}

-/* Helper function which does the work for make_cleanup_fclose. */
-
-static void
-do_fclose_cleanup (void *arg)
-{
- FILE *file = (FILE *) arg;
-
- fclose (file);
-}
-
-/* Return a new cleanup that closes FILE. */
-
-struct cleanup *
-make_cleanup_fclose (FILE *file)
-{
- return make_cleanup (do_fclose_cleanup, file);
-}
-
/* Helper function which does the work for make_cleanup_obstack_free. */

static void
diff --git a/gdb/utils.h b/gdb/utils.h
index f3e8007..7afb3c5 100644
--- a/gdb/utils.h
+++ b/gdb/utils.h
@@ -76,8 +76,6 @@ extern struct cleanup *(make_cleanup_free_section_addr_info

/* For make_cleanup_close see common/filestuff.h. */

-extern struct cleanup *make_cleanup_fclose (FILE *file);
-
struct obstack;
extern struct cleanup *make_cleanup_obstack_free (struct obstack *obstack);

--
2.9.3