mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-10-13 10:55:46 +08:00
* sol-thread.c (restore_inferior_pid): Save the PID in a freshly
allocated buffer. (save_inferior_pid): Restore the PID from that tempoary buffer. Delete the buffer. * utils.c (make_cleanup_close, do_close_cleanup): Ditto for FD.
This commit is contained in:
@ -215,14 +215,17 @@ make_cleanup_bfd_close (bfd *abfd)
|
||||
static void
|
||||
do_close_cleanup (void *arg)
|
||||
{
|
||||
close ((int) arg);
|
||||
int *fd = arg;
|
||||
close (*fd);
|
||||
xfree (fd);
|
||||
}
|
||||
|
||||
struct cleanup *
|
||||
make_cleanup_close (int fd)
|
||||
{
|
||||
/* int into void*. Outch!! */
|
||||
return make_cleanup (do_close_cleanup, (void *) fd);
|
||||
int *saved_fd = xmalloc (sizeof (fd));
|
||||
*saved_fd = fd;
|
||||
return make_cleanup (do_close_cleanup, saved_fd);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user