Add make_cleanup_close() function.
This commit is contained in:
parent
ba09750c1e
commit
f5ff8c83c8
3 changed files with 20 additions and 0 deletions
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue