From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40335 invoked by alias); 10 Dec 2019 16:41: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 40322 invoked by uid 89); 10 Dec 2019 16:41:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (205.139.110.61) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 10 Dec 2019 16:41:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575996110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R/VWukKFVqiRL8Q12GUQDr5+cywPvGFQyLARNGsi9w0=; b=FvkGhi2orMNmNbSAuAEewrz0K7dGYOk+Lw921aejBfIbRxBdIOlBMLWNvUmBTVj7NwN5ZY h1M++2JGssZ4RBQrhDrLhY4aWoihXcTwarUiOE4BgRDvexprTWonlhC3d/Tn9n1Xu2bXrt ski9Tx7CWxSFWsbjS0DgTgmC4zMlEwg= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-68-aZbvrI02OTKUDOAOJXeyBA-1; Tue, 10 Dec 2019 11:41:49 -0500 Received: by mail-wm1-f70.google.com with SMTP id g1so1216670wmg.4 for ; Tue, 10 Dec 2019 08:41:48 -0800 (PST) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id d6sm3663066wmb.6.2019.12.10.08.41.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 10 Dec 2019 08:41:46 -0800 (PST) Subject: Re: [PATCH v3] Replace the remaining uses of strerror with safe_strerror To: Christian Biesinger , gdb-patches@sourceware.org References: <20191209191303.131746-1-cbiesinger@google.com> From: Pedro Alves Message-ID: <0c0f5c29-6e43-ef01-20c1-f7acd89c9176@redhat.com> Date: Tue, 10 Dec 2019 16:41:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20191209191303.131746-1-cbiesinger@google.com> X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-12/txt/msg00371.txt.bz2 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, Pedro Alves