From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 52316 invoked by alias); 10 Dec 2019 19:25:53 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 52307 invoked by uid 89); 10 Dec 2019 19:25:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.5 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy= X-HELO: mail-ot1-f68.google.com Received: from mail-ot1-f68.google.com (HELO mail-ot1-f68.google.com) (209.85.210.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Dec 2019 19:25:52 +0000 Received: by mail-ot1-f68.google.com with SMTP id 59so16530668otp.12 for ; Tue, 10 Dec 2019 11:25:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wRzLTD6NCd+bO7d8lljlneKzFaIHInRyfsVmuzLfi5M=; b=AB6ns7D0F33N1r7wYKIrZ913pjwLh3S/bcJbCS4GReB6e97PqRrBrDde2bk9GcKXeo ipGIe8QRGiv4mW1yu5zXyaqeBa2cnYVBYEWF+eD70vBD6/pWrWEyHGQzYl8MWQzztc1l EkKNc8ijinWnwlPEKqSbElbk3KdcrvruZ4+79x6vdsdDygh/0sEYk/tvZrV2EF74UQAu Fli3HHuXVEVns9HdJRq67vioGO/ovWtb+RjEDqtIQMNr4DAGagk/QBo3Q+gk48Hf2+8y tkvNv6CQQNLvvmWuZeD6fdMw/Mchae4K17mKVMerXJgQOkI6vOvqzLsSX0tN1bsO4VaG 2urg== MIME-Version: 1.0 References: <20191209191303.131746-1-cbiesinger@google.com> <0c0f5c29-6e43-ef01-20c1-f7acd89c9176@redhat.com> In-Reply-To: <0c0f5c29-6e43-ef01-20c1-f7acd89c9176@redhat.com> From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Tue, 10 Dec 2019 19:25:00 -0000 Message-ID: Subject: Re: [PATCH v3] Replace the remaining uses of strerror with safe_strerror To: Pedro Alves Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-12/txt/msg00372.txt.bz2 On Tue, Dec 10, 2019 at 11:41 AM Pedro Alves 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