Re: [PATCH 02/10] remote: Eliminate remote_hostio_close_cleanup

Tom Tromey
2018-05-16T17:37:32Z

>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Pedro> + ~scoped_remote_fd ()
Pedro> + {
Pedro> + if (m_fd != -1)
Pedro> + {
Pedro> + int remote_errno;
Pedro> + remote_hostio_close (find_target_at (process_stratum),
Pedro> + m_fd, &remote_errno);

The only danger here is if remote_hostio_close can throw. However, this
was already a danger (in theory) before the patch -- there is a rule
(perhaps unwritten and/or unenforced) that one cannot throw during a
"do_cleanups".

I didn't look but some assurance that this can't happen would be good to
have.

Tom