From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26080 invoked by alias); 27 May 2013 11:41:58 -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 26063 invoked by uid 89); 27 May 2013 11:41:58 -0000 X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,SPF_PASS,TW_XS autolearn=ham version=3.3.1 Received: from mail-bk0-f48.google.com (HELO mail-bk0-f48.google.com) (209.85.214.48) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 27 May 2013 11:41:57 +0000 Received: by mail-bk0-f48.google.com with SMTP id jf20so2144293bkc.21 for ; Mon, 27 May 2013 04:41:55 -0700 (PDT) X-Received: by 10.204.229.141 with SMTP id ji13mr1103729bkb.70.1369654915068; Mon, 27 May 2013 04:41:55 -0700 (PDT) Received: from [130.237.20.66] (s1499.it.kth.se. [130.237.20.66]) by mx.google.com with ESMTPSA id jm15sm8236325bkb.13.2013.05.27.04.41.53 for (version=SSLv3 cipher=RC4-SHA bits=128/128); Mon, 27 May 2013 04:41:54 -0700 (PDT) Message-ID: <1369654913.8127.84.camel@s1499.it.kth.se> Subject: Re: Small patch to enable build of gdb-7.6 for GNU/Hurd From: Svante Signell To: Sergio Durigan Junior Cc: Pedro Alves , Joel Brobecker , gdb-patches@sourceware.org Date: Mon, 27 May 2013 11:41:00 -0000 In-Reply-To: References: <1369326967.8127.33.camel@s1499.it.kth.se> <20130524042734.GG4017@adacore.com> <519F2A7A.4050002@redhat.com> <1369386446.8127.51.camel@s1499.it.kth.se> Content-Type: multipart/mixed; boundary="=-PcI8nhtaTIUdcF/zfjju" Mime-Version: 1.0 X-Virus-Found: No X-SW-Source: 2013-05/txt/msg00946.txt.bz2 --=-PcI8nhtaTIUdcF/zfjju Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 508 On Fri, 2013-05-24 at 06:13 -0300, Sergio Durigan Junior wrote: > On Friday, May 24 2013, Svante Signell wrote: > > > I will change to use xstrprintf instead. Updated patch with ChangeLog > > entry will follow shortly. Is it OK to modify also the other (preceding) > > function in the same way (for consistency)? > > Thanks. It is OK IMO, but I'd prefer if you did that in a separate > patch. Attached is an updated patch for the build problems on systems where PATH_MAX is not defined. Thanks, Svante --=-PcI8nhtaTIUdcF/zfjju Content-Disposition: attachment; filename="solve_PATH_MAX_issue.patch" Content-Type: text/x-patch; name="solve_PATH_MAX_issue.patch"; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 830 --- a/gdb/nto-tdep.c 2013-05-23 14:28:24.000000000 +0000 +++ b/gdb/nto-tdep.c 2013-05-27 10:54:13.000000000 +0000 @@ -147,7 +147,7 @@ nto_find_and_open_solib (char *solib, un void nto_init_solib_absolute_prefix (void) { - char buf[PATH_MAX * 2], arch_path[PATH_MAX]; + char *buf, *arch_path; char *nto_root, *endian; const char *arch; @@ -172,10 +172,11 @@ nto_init_solib_absolute_prefix (void) == BFD_ENDIAN_BIG ? "be" : "le"; } - xsnprintf (arch_path, sizeof (arch_path), "%s/%s%s", nto_root, arch, endian); - - xsnprintf (buf, sizeof (buf), "set solib-absolute-prefix %s", arch_path); + arch_path = xstrprintf ("%s/%s%s", nto_root, arch, endian); + buf = xstrprintf ("set solib-absolute-prefix \"%s\"", arch_path); + xfree(arch_path); execute_command (buf, 0); + xfree(buf); } char ** --=-PcI8nhtaTIUdcF/zfjju Content-Disposition: attachment; filename="ChangeLog.solve_PATH_MAX_issue" Content-Type: text/plain; name="ChangeLog.solve_PATH_MAX_issue"; charset="UTF-8" Content-Transfer-Encoding: 7bit Content-length: 201 2013-05-27 Svante Signell * nto-tdep.c (nto_init_solib_absolute_prefix): Solve build problems for systems not defining PATH_MAX by using xstrprintf and a cleanup. --=-PcI8nhtaTIUdcF/zfjju--