Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH] Remove variable in get_startup_shell non-static
Date: Thu, 13 Sep 2018 22:35:00 -0000	[thread overview]
Message-ID: <20180913223416.12824-1-tom@tromey.com> (raw)

I noticed that a variable in get_startup_shell is "static".  However,
I couldn't see any reason it ought to be, so this removes the
"static".

gdb/ChangeLog
2018-09-13  Tom Tromey  <tom@tromey.com>

	* nat/fork-inferior.c (get_startup_shell): Remove "static".
---
 gdb/ChangeLog           | 4 ++++
 gdb/nat/fork-inferior.c | 4 +---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gdb/nat/fork-inferior.c b/gdb/nat/fork-inferior.c
index ea71aad25f7..40cd05a0f8f 100644
--- a/gdb/nat/fork-inferior.c
+++ b/gdb/nat/fork-inferior.c
@@ -272,9 +272,7 @@ execv_argv::init_for_shell (const char *exec_file,
 static const char *
 get_startup_shell ()
 {
-  static const char *ret;
-
-  ret = getenv ("SHELL");
+  const char *ret = getenv ("SHELL");
   if (ret == NULL)
     ret = SHELL_FILE;
 
-- 
2.17.1


             reply	other threads:[~2018-09-13 22:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13 22:35 Tom Tromey [this message]
2018-09-13 23:33 ` Sergio Durigan Junior
2018-09-14 12:46   ` Tom Tromey
2018-09-15  2:59   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180913223416.12824-1-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox