Add make_cleanup_close() function.

This commit is contained in:
Andrew Cagney 2000-05-23 14:48:13 +00:00
parent ba09750c1e
commit f5ff8c83c8
3 changed files with 20 additions and 0 deletions

View file

@ -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)
{