From f5ff8c83c82bcf6d152bf5390a6ca8716dab1de3 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Tue, 23 May 2000 14:48:13 +0000 Subject: Add make_cleanup_close() function. --- gdb/utils.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gdb/utils.c') diff --git a/gdb/utils.c b/gdb/utils.c index 8e2c5c5..6f5264a 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); -- cgit v1.1