mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-12-01 07:50:49 +00:00
* utils.c (make_cleanup_close): Use make_cleanup_dtor.
(do_close_cleanup): Don't free 'fd'.
This commit is contained in:
parent
9fe4a2165d
commit
a05016c09e
@ -1,3 +1,8 @@
|
||||
2008-10-30 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* utils.c (make_cleanup_close): Use make_cleanup_dtor.
|
||||
(do_close_cleanup): Don't free 'fd'.
|
||||
|
||||
2008-10-28 Tom Tromey <tromey@redhat.com>
|
||||
|
||||
* source.c (symtab_to_fullname): Test 'r >= 0'.
|
||||
|
@ -244,7 +244,6 @@ do_close_cleanup (void *arg)
|
||||
{
|
||||
int *fd = arg;
|
||||
close (*fd);
|
||||
xfree (fd);
|
||||
}
|
||||
|
||||
struct cleanup *
|
||||
@ -252,7 +251,7 @@ make_cleanup_close (int fd)
|
||||
{
|
||||
int *saved_fd = xmalloc (sizeof (fd));
|
||||
*saved_fd = fd;
|
||||
return make_cleanup (do_close_cleanup, saved_fd);
|
||||
return make_cleanup_dtor (do_close_cleanup, saved_fd, xfree);
|
||||
}
|
||||
|
||||
/* Helper function which does the work for make_cleanup_fclose. */
|
||||
|
Loading…
Reference in New Issue
Block a user