From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 63298 invoked by alias); 28 Feb 2020 19:50:11 -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 63290 invoked by uid 89); 28 Feb 2020 19:50:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=H*i:sk:87lfomi, H*f:sk:87lfomi, HX-Languages-Length:1366 X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 28 Feb 2020 19:50:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582919408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gCGdqd27QJqoNXn8q4ZIv2w9H8YrIkadUjN4b5qJcPk=; b=OEXfdmK71uVba1L+qwc0oxRfMzqyFo9JRZChxuQuEEIa1uObWhgnyR7D7fFDNOjg+9lxhk kGWr7z8jdlWw2dB7X4NNI97KhbcNhd+1O53aftpCgmrB+JV8nMcKotIxJjh51yLd/LRTc5 90J+U9dT2K4uv/iP9rJWOSc6CKPq9No= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-310-tJzxt1qsMAKbFfpHX_Fgkg-1; Fri, 28 Feb 2020 14:50:06 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CBAA3107ACC9; Fri, 28 Feb 2020 19:50:04 +0000 (UTC) Received: from localhost (unused-10-15-17-54.yyz.redhat.com [10.15.17.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9887B90F5B; Fri, 28 Feb 2020 19:50:04 +0000 (UTC) From: Sergio Durigan Junior To: Tom Tromey Cc: GDB Patches , Pedro Alves , Eli Zaretskii , Ruslan Kabatsayev Subject: Re: [PATCH 2/6] Don't reset errno/bfd_error on 'throw_perror_with_name' References: <20190926042155.31481-1-sergiodj@redhat.com> <20200226200542.746617-1-sergiodj@redhat.com> <20200226200542.746617-3-sergiodj@redhat.com> <87wo86ivbu.fsf@tromey.com> <875zfqr7mz.fsf@redhat.com> <87lfomilnt.fsf@tromey.com> Date: Fri, 28 Feb 2020 19:50:00 -0000 In-Reply-To: <87lfomilnt.fsf@tromey.com> (Tom Tromey's message of "Fri, 28 Feb 2020 11:58:30 -0700") Message-ID: <87sgiupk43.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg01071.txt.bz2 On Friday, February 28 2020, Tom Tromey wrote: >>>>>> "Sergio" =3D=3D Sergio Durigan Junior 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 exp= licitly > 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 perr= or > 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 messa= ge. > > 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 :) Right, that's an excellent argument. It's safe to leave the line out right now; the important thing is that we don't touch errno, anyway. Thanks, --=20 Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/