Re: [PATCH 2/6] Don't reset errno/bfd_error on 'throw_perror_with_name'

Tom Tromey
2020-02-28T18:58:34Z

>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:

>> I didn't understand why this one was needed.
>> Does safe_strerror reset errno? Maybe a comment would be in order.

Sergio> Ah, no, safe_strerror doesn't reset errno. As I explained in the commit
Sergio> message, it is not allowed to do so. The reason I decided to explicitly
Sergio> save/restore errno is because I wanted to make sure that we (also
Sergio> explicitly) follow the same rules for both GDB and gdbserver perror
Sergio> functions. But now I'm left thinking that I should have proposed the
Sergio> same thing for 'throw_perror_with_name'...

Sergio> Anyway, I'm fine with removing the save/restore from gdbserver's
Sergio> perror. I'll also remove the reference to it in the commit message.

The main thing for me is that when someone sees this in 5 years, that
there's some idea of why the line is there. Leaving the line out is
just as good :)

thanks,
Tom