forked from Imagelibrary/binutils-gdb
Add make_cleanup_close() function.
This commit is contained in:
13
gdb/utils.c
13
gdb/utils.c
@@ -215,6 +215,19 @@ make_cleanup_bfd_close (bfd *abfd)
|
||||
return make_cleanup (do_bfd_close_cleanup, 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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user