From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13245 invoked by alias); 28 Feb 2018 16:46:06 -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 12955 invoked by uid 89); 28 Feb 2018 16:46:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,TRACKER_ID,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1450 X-HELO: mx1.redhat.com Received: from mx3-rdu2.redhat.com (HELO mx1.redhat.com) (66.187.233.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Feb 2018 16:46:01 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C02B40FB646; Wed, 28 Feb 2018 16:46:00 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 525712024CA8; Wed, 28 Feb 2018 16:46:00 +0000 (UTC) From: Sergio Durigan Junior To: Simon Marchi Cc: GDB Patches , Pedro Alves , Joel Brobecker Subject: Re: [PATCH v3 1/2] Create new common/pathstuff.[ch] References: <20180210014241.19278-3-sergiodj@redhat.com> <20180228032708.19670-1-sergiodj@redhat.com> <20180228032708.19670-2-sergiodj@redhat.com> <7555f173-8517-ef9f-897c-e1934cc3b942@ericsson.com> Date: Wed, 28 Feb 2018 16:46:00 -0000 In-Reply-To: <7555f173-8517-ef9f-897c-e1934cc3b942@ericsson.com> (Simon Marchi's message of "Wed, 28 Feb 2018 00:01:48 -0500") Message-ID: <87a7vtkqpj.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00470.txt.bz2 On Wednesday, February 28 2018, Simon Marchi wrote: > On 2018-02-27 10:27 PM, Sergio Durigan Junior wrote: >> diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c >> index cb02b58507..922d5269b3 100644 >> --- a/gdb/gdbserver/server.c >> +++ b/gdb/gdbserver/server.c >> @@ -56,6 +56,10 @@ >> break; \ >> } >> >> +/* String containing the current directory (what getwd would return). */ >> + >> +char *current_directory; >> + >> /* The environment to pass to the inferior when creating it. */ >> >> static gdb_environ our_environ; >> @@ -3539,6 +3543,13 @@ captured_main (int argc, char *argv[]) >> const char *selftest_filter = NULL; >> #endif >> >> + current_directory = getcwd (NULL, 0); >> + if (current_directory == NULL) >> + { >> + error (_("%s: error finding working directory"), >> + safe_strerror (errno)); >> + } > > Just one thing, I think Pedro suggested to put the variable string at the end: > > error (_("Could not find working directory: %s"), > safe_strerror (errno)); Ah, that's right, sorry about this, I got confused. And I didn't get this message on my INBOX, so I went ahead and pushed the commit without this change. I took the liberty to push an obvious commit now fixing this. 815615463b1171cbff7c5e54f62fc708cc1bbc99 Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/