summaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2000-05-23 14:48:13 +0000
committerAndrew Cagney <cagney@redhat.com>2000-05-23 14:48:13 +0000
commitb3a82342b20766f911ac31ba9df8c2f9852c61fa (patch)
tree80943442ac86979c3227efa2412ec0627298fc5f /gdb/utils.c
parentbf413ee17ab0ba49b941d6a53d8856d17df2356f (diff)
downloadgdb-b3a82342b20766f911ac31ba9df8c2f9852c61fa.tar.gz
Add make_cleanup_close() function.
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 8e2c5c550f8..6f5264a8d11 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -216,6 +216,19 @@ make_cleanup_bfd_close (bfd *abfd)
}
static void
+do_close_cleanup (void *arg)
+{
+ close ((int) arg);
+}
+
+struct cleanup *
+make_cleanup_close (int fd)
+{
+ /* int into void*. Outch!! */
+ return make_cleanup (do_close_cleanup, (void *) fd);
+}
+
+static void
do_ui_file_delete (void *arg)
{
ui_file_delete (arg);