aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2008-10-28 15:22:13 +0000
committerTom Tromey <tromey@redhat.com>2008-10-28 15:22:13 +0000
commit7c8a8b0498cb16b1a36e3210977eae12cca98f64 (patch)
tree276b941fb714e325a2f0f9c2f3ec245e7208751f /gdb/remote.c
parent0f3e7e3c00105f22f385228be5e5e9df2afe140c (diff)
downloadgdb-7c8a8b0498cb16b1a36e3210977eae12cca98f64.zip
gdb-7c8a8b0498cb16b1a36e3210977eae12cca98f64.tar.gz
gdb-7c8a8b0498cb16b1a36e3210977eae12cca98f64.tar.bz2
* 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.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 6af8267..9f10c2a 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -8213,12 +8213,6 @@ remote_hostio_error (int errnum)
}
static void
-fclose_cleanup (void *file)
-{
- fclose (file);
-}
-
-static void
remote_hostio_close_cleanup (void *opaque)
{
int fd = *(int *) opaque;
@@ -8335,7 +8329,7 @@ remote_file_put (const char *local_file, const char *remote_file, int from_tty)
file = fopen (local_file, "rb");
if (file == NULL)
perror_with_name (local_file);
- back_to = make_cleanup (fclose_cleanup, file);
+ back_to = make_cleanup_fclose (file);
fd = remote_hostio_open (remote_file, (FILEIO_O_WRONLY | FILEIO_O_CREAT
| FILEIO_O_TRUNC),
@@ -8425,7 +8419,7 @@ remote_file_get (const char *remote_file, const char *local_file, int from_tty)
file = fopen (local_file, "wb");
if (file == NULL)
perror_with_name (local_file);
- back_to = make_cleanup (fclose_cleanup, file);
+ back_to = make_cleanup_fclose (file);
/* Send up to this many bytes at once. They won't all fit in the
remote packet limit, so we'll transfer slightly fewer. */