From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 113075 invoked by alias); 31 Oct 2019 20:05:39 -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 113025 invoked by uid 89); 31 Oct 2019 20:05:39 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1967 X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 31 Oct 2019 20:05:37 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 6DE4F2047F; Thu, 31 Oct 2019 16:05:36 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [IPv6:2620:52:3:1:5054:ff:fe06:16ca]) by mx1.osci.io (Postfix) with ESMTP id AE83A20465; Thu, 31 Oct 2019 16:05:29 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 8784D218A2; Thu, 31 Oct 2019 16:05:29 -0400 (EDT) X-Gerrit-PatchSet: 2 Date: Thu, 31 Oct 2019 20:05:00 -0000 From: "Christian Biesinger (Code Review)" To: Christian Biesinger , gdb-patches@sourceware.org Cc: Simon Marchi Auto-Submitted: auto-generated X-Gerrit-MessageType: comment Subject: [review v2] Use strerror_r in safe_strerror if available X-Gerrit-Change-Id: I81048fbaf148035c221c528727f7efe58ba528eb X-Gerrit-Change-Number: 474 X-Gerrit-ChangeURL: X-Gerrit-Commit: 2c68e392fbe517d963b73767aaf45c76a979534a In-Reply-To: References: X-Gerrit-Comment-Date: Thu, 31 Oct 2019 16:05:29 -0400 Reply-To: gnutoolchain-gerrit@osci.io MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/3.0.3-75-g9005159e5d Content-Type: text/plain; charset=UTF-8 Message-Id: <20191031200529.8784D218A2@gnutoolchain-gerrit.osci.io> X-SW-Source: 2019-10/txt/msg01196.txt.bz2 Christian Biesinger has posted comments on this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/474 ...................................................................... Uploaded patch set 2. (2 comments) https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/474/1/gdb/gdbsupport/posix-strerror.c File gdb/gdbsupport/posix-strerror.c: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/474/1/gdb/gdbsupport/posix-strerror.c@24 PS1, Line 24: 19 | 20 | #include "common-defs.h" 21 | 22 | /* Implementation of safe_strerror as defined in common-utils.h. */ 23 | 24 > char * 25 | safe_strerror (int errnum) 26 | { 27 | static thread_local char buf[1024]; 28 | 29 | char *msg = nullptr; > Just wondering, maybe we could make safe_strerror return a `const char *`? I suppose we never want […] Done, only two callers needed changes. https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/474/1/gdb/gdbsupport/posix-strerror.c@31 PS1, Line 31: 26 | { 27 | static thread_local char buf[1024]; 28 | 29 | char *msg = nullptr; 30 | #ifdef HAVE_STRERROR_R 31 > #if !__GLIBC__ || ((_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE) 32 | /* Glibc has two different, incompatible versions of strerror_r. */ 33 | if (strerror_r (errnum, buf, sizeof (buf)) == 0) 34 | msg = buf; 35 | #else 36 | msg = strerror_r (errnum, buf, sizeof (buf)); > Just a nit, can you "indent" the preprocessor declarations, like […] Good idea, done. -- Gerrit-Project: binutils-gdb Gerrit-Branch: master Gerrit-Change-Id: I81048fbaf148035c221c528727f7efe58ba528eb Gerrit-Change-Number: 474 Gerrit-PatchSet: 2 Gerrit-Owner: Christian Biesinger Gerrit-CC: Simon Marchi Gerrit-Comment-Date: Thu, 31 Oct 2019 20:05:29 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: Simon Marchi Gerrit-MessageType: comment