From d078c7b7e00ebbc6ada4a0cd43fc3f901ed0923f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 28 Oct 2008 15:22:11 +0000 Subject: * cli/cli-script.c (do_fclose_cleanup): Remove. (script_from_file): Use make_cleanup_fclose. * xml-tdesc.c (do_cleanup_fclose): Remove. (fetch_xml_from_file): Use make_cleanup_fclose. * tracepoint.c (tracepoint_save_command): Use make_cleanup_fclose. Always free pathname. * source.c (print_source_lines_base): Use make_cleanup_fclose. * remote.c (fclose_cleanup): Remove. (remote_file_put): Use make_cleanup_fclose. (remote_file_get): Likewise. * linux-nat.c (linux_nat_find_memory_regions): Use make_cleanup_fclose. (linux_nat_info_proc_cmd): Likewise. (linux_proc_pending_signals): Likewise. * fbsd-nat.c (fbsd_find_memory_regions): Use make_cleanup_fclose. Free file name. * cli/cli-dump.c (do_fclose_cleanup): Remove. (make_cleanup_fclose): Remove. * defs.h (make_cleanup_fclose): Declare. * utils.c (do_fclose_cleanup): New function. (make_cleanup_fclose): Likewise. --- gdb/xml-tdesc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'gdb/xml-tdesc.c') diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c index 42bc4a03416..2e8c1f53781 100644 --- a/gdb/xml-tdesc.c +++ b/gdb/xml-tdesc.c @@ -421,14 +421,6 @@ tdesc_parse_xml (const char *document, xml_fetch_another fetcher, #endif /* HAVE_LIBEXPAT */ -/* Close FILE. */ - -static void -do_cleanup_fclose (void *file) -{ - fclose (file); -} - /* Open FILENAME, read all its text into memory, close it, and return the text. If something goes wrong, return NULL and warn. */ @@ -455,7 +447,7 @@ fetch_xml_from_file (const char *filename, void *baton) if (file == NULL) return NULL; - back_to = make_cleanup (do_cleanup_fclose, file); + back_to = make_cleanup_fclose (file); /* Read in the whole file, one chunk at a time. */ len = 4096; -- cgit v1.2.1