git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elia Pinto <gitter.spiros@gmail.com>
To: git@vger.kernel.org
Cc: Elia Pinto <gitter.spiros@gmail.com>
Subject: [PATCH 7/7] builtin/gc.c: reduce scope of variables
Date: Wed, 29 Jan 2014 08:59:37 -0800	[thread overview]
Message-ID: <1391014777-13582-1-git-send-email-gitter.spiros@gmail.com> (raw)

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 builtin/gc.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/builtin/gc.c b/builtin/gc.c
index c19545d..5bbb5e3 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -188,13 +188,12 @@ static int need_to_gc(void)
 static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
 {
 	static struct lock_file lock;
-	static char locking_host[128];
 	char my_host[128];
 	struct strbuf sb = STRBUF_INIT;
 	struct stat st;
 	uintmax_t pid;
 	FILE *fp;
-	int fd, should_exit;
+	int fd;
 
 	if (pidfile)
 		/* already locked */
@@ -206,6 +205,8 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)
 	fd = hold_lock_file_for_update(&lock, git_path("gc.pid"),
 				       LOCK_DIE_ON_ERROR);
 	if (!force) {
+		static char locking_host[128];
+		int should_exit;
 		fp = fopen(git_path("gc.pid"), "r");
 		memset(locking_host, 0, sizeof(locking_host));
 		should_exit =
-- 
1.7.10.4

                 reply	other threads:[~2014-01-29 16:59 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1391014777-13582-1-git-send-email-gitter.spiros@gmail.com \
    --to=gitter.spiros@gmail.com \
    --cc=git@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).