aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-dump.c13
-rw-r--r--gdb/cli/cli-script.c8
2 files changed, 1 insertions, 20 deletions
diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
index 67a9fc5..d5dbc97 100644
--- a/gdb/cli/cli-dump.c
+++ b/gdb/cli/cli-dump.c
@@ -67,19 +67,6 @@ scan_expression_with_cleanup (char **cmd, const char *def)
}
-static void
-do_fclose_cleanup (void *arg)
-{
- FILE *file = arg;
- fclose (arg);
-}
-
-static struct cleanup *
-make_cleanup_fclose (FILE *file)
-{
- return make_cleanup (do_fclose_cleanup, file);
-}
-
char *
scan_filename_with_cleanup (char **cmd, const char *defname)
{
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;