From 7c8a8b0498cb16b1a36e3210977eae12cca98f64 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 28 Oct 2008 15:22:13 +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/cli/cli-script.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'gdb/cli/cli-script.c') diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 6bfff40..e65c29e 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -1446,12 +1446,6 @@ source_cleanup_lines (void *args) source_file_name = p->old_file; } -static void -do_fclose_cleanup (void *stream) -{ - fclose (stream); -} - struct wrapped_read_command_file_args { FILE *stream; @@ -1476,7 +1470,7 @@ script_from_file (FILE *stream, char *file) if (stream == NULL) internal_error (__FILE__, __LINE__, _("called with NULL file pointer!")); - old_cleanups = make_cleanup (do_fclose_cleanup, stream); + old_cleanups = make_cleanup_fclose (stream); old_lines.old_line = source_line_number; old_lines.old_file = source_file_name; -- cgit v1.1