From patchwork Fri Aug 21 21:21:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 8355 Received: (qmail 104481 invoked by alias); 21 Aug 2015 21:21:12 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 104322 invoked by uid 89); 21 Aug 2015 21:21:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 21 Aug 2015 21:21:09 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id D1FFFC9D29 for ; Fri, 21 Aug 2015 21:21:06 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7LLL5if018882 for ; Fri, 21 Aug 2015 17:21:05 -0400 Subject: [PATCH v12 07/32] Code cleanup: Make solib_find_1 variable const From: Jan Kratochvil To: gdb-patches@sourceware.org Date: Fri, 21 Aug 2015 23:21:04 +0200 Message-ID: <20150821212104.6673.10903.stgit@host1.jankratochvil.net> In-Reply-To: <20150821212006.6673.35100.stgit@host1.jankratochvil.net> References: <20150821212006.6673.35100.stgit@host1.jankratochvil.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-IsSubscribed: yes Hi, it gets used in the next patch. Jan 2015-08-18 Jan Kratochvil * solib.c (solib_find_1): Make sysroot variable const. --- 0 files changed diff --git a/gdb/solib.c b/gdb/solib.c index cf78f6a..be31ffd 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -157,7 +157,7 @@ solib_find_1 (char *in_pathname, int *fd, int is_solib) char *temp_pathname = NULL; const char *fskind = effective_target_file_system_kind (); struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); - char *sysroot = gdb_sysroot; + const char *sysroot = gdb_sysroot; int prefix_len, orig_prefix_len; /* If the absolute prefix starts with "target:" but the filesystem @@ -179,8 +179,10 @@ solib_find_1 (char *in_pathname, int *fd, int is_solib) sysroot = NULL; else if (prefix_len != orig_prefix_len) { - sysroot = savestring (sysroot, prefix_len); - make_cleanup (xfree, sysroot); + char *s = savestring (sysroot, prefix_len); + + make_cleanup (xfree, s); + sysroot = s; } /* If we're on a non-DOS-based system, backslashes won't be