[PATCH v3] Replace the remaining uses of strerror with safe_strerror
Christian Biesinger via gdb-patches
gdb-patches@sourceware.org
Tue Dec 10 19:25:00 GMT 2019
On Tue, Dec 10, 2019 at 11:41 AM Pedro Alves <palves@redhat.com> wrote:
>
> On 12/9/19 7:13 PM, Christian Biesinger via gdb-patches wrote:
>
> > +/* There are two different versions of strerror_r; one is GNU-specific, the
> > + other XSI-compliant. They differ in the return type. This overload lets
> > + us choose the right behavior for each return type. We cannot rely on Gnulib
> > + to solve this for us because IPA does not use Gnulib but uses this
> > + function. */
> > +
> > +/* Called if we have a XSI-compliant strerror_r. */
> > +static char *select_strerror_r (int res, char *buf)
>
> Formatting:
>
> static char *
> select_strerror_r (int res, char *buf)
>
>
> > +{
> > + return res == 0 ? buf : nullptr;
> > +}
> > +
> > +/* Called if we have a GNU strerror_r. */
> > +static char *select_strerror_r (char *res, char *)
>
> Ditto.
>
> > +{
> > + return res;
> > +}
> > +
> OK with those changes.
Thanks, made those changes and pushed. Also updated the commit message.
To ssh://sourceware.org/git/binutils-gdb.git
0e7aaa728d..ab7d13f070 HEAD -> master
Christian
More information about the Gdb-patches
mailing list