{"thread":{"id":"35758","subject":"[PATCH 7/7] builtin/gc.c: reduce scope of variables","startedAt":"2014-01-29T16:59:37Z","lastAt":"2014-01-29T16:59:37Z","messageCount":1,"participants":["Elia Pinto"],"isPatch":true,"patchVersion":1,"patchTotal":7},"messages":[{"id":"233893","messageId":"1391014777-13582-1-git-send-email-gitter.spiros@gmail.com","threadId":"35758","inReplyTo":null,"subject":"[PATCH 7/7] builtin/gc.c: reduce scope of variables","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-01-29T16:59:37Z","receivedAt":"2014-01-29T16:59:37Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n builtin/gc.c |    5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/gc.c b/builtin/gc.c\nindex c19545d..5bbb5e3 100644\n--- a/builtin/gc.c\n+++ b/builtin/gc.c\n@@ -188,13 +188,12 @@ static int need_to_gc(void)\n static const char *lock_repo_for_gc(int force, pid_t* ret_pid)\n {\n \tstatic struct lock_file lock;\n-\tstatic char locking_host[128];\n \tchar my_host[128];\n \tstruct strbuf sb = STRBUF_INIT;\n \tstruct stat st;\n \tuintmax_t pid;\n \tFILE *fp;\n-\tint fd, should_exit;\n+\tint fd;\n \n \tif (pidfile)\n \t\t/* already locked */\n@@ -206,6 +205,8 @@ static const char *lock_repo_for_gc(int force, pid_t* ret_pid)\n \tfd = hold_lock_file_for_update(&lock, git_path(\"gc.pid\"),\n \t\t\t\t       LOCK_DIE_ON_ERROR);\n \tif (!force) {\n+\t\tstatic char locking_host[128];\n+\t\tint should_exit;\n \t\tfp = fopen(git_path(\"gc.pid\"), \"r\");\n \t\tmemset(locking_host, 0, sizeof(locking_host));\n \t\tshould_exit =\n-- \n1.7.10.4\n"}]}