# [PATCH] tmp-objdir: mark some file local symbols static

2 messages from 2016-10-01 to 2016-10-02. Participants: Ramsay Jones, Jeff King.
Thread: https://gitlist.dev/t/44197

## Ramsay Jones, 2016-10-01 23:07

Subject: [PATCH] tmp-objdir: mark some file local symbols static
Message-ID: <f5560f8b-75be-faa0-ce1c-5e2716ee82a5@ramsayjones.plus.com>
URL: https://gitlist.dev/e/f5560f8b-75be-faa0-ce1c-5e2716ee82a5%40ramsayjones.plus.com

```

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---

Hi Jeff,

If you need to re-roll your 'jk/quarantine-received-objects' branch,
could you please squash this into the relevant patches.

[I also note that tmp_objdir_destroy(), declared to be part of the
public interface, is not currently called from outside tmp_objdir.c.
Despite being unlikely, it is at least plausible that this function
may be useful in future. ;-) ]

Thanks!

ATB,
Ramsay Jones

 builtin/receive-pack.c | 2 +-
 tmp-objdir.c           | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 25afa3f..4194088 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -87,7 +87,7 @@ static enum {
 } use_keepalive;
 static int keepalive_in_sec = 5;
 
-struct tmp_objdir *tmp_objdir;
+static struct tmp_objdir *tmp_objdir;
 
 static enum deny_action parse_deny_action(const char *var, const char *value)
 {
diff --git a/tmp-objdir.c b/tmp-objdir.c
index 2181a42..3a58404 100644
--- a/tmp-objdir.c
+++ b/tmp-objdir.c
@@ -17,7 +17,7 @@ struct tmp_objdir {
  * more than one, and we can expand later if so.  You can have many such
  * tmp_objdirs simultaneously in many processes, of course.
  */
-struct tmp_objdir *the_tmp_objdir;
+static struct tmp_objdir *the_tmp_objdir;
 
 static void tmp_objdir_free(struct tmp_objdir *t)
 {
-- 
2.10.0

```

## Jeff King, 2016-10-02 12:13

Subject: Re: [PATCH] tmp-objdir: mark some file local symbols static
Message-ID: <20161002121311.4febd7jtc4yv5fev@sigill.intra.peff.net>
URL: https://gitlist.dev/e/20161002121311.4febd7jtc4yv5fev%40sigill.intra.peff.net
In-Reply-To: <f5560f8b-75be-faa0-ce1c-5e2716ee82a5@ramsayjones.plus.com>

```
On Sun, Oct 02, 2016 at 12:07:27AM +0100, Ramsay Jones wrote:

> If you need to re-roll your 'jk/quarantine-received-objects' branch,
> could you please squash this into the relevant patches.

Oops, thanks. Don't know how I missed both of these.

> [I also note that tmp_objdir_destroy(), declared to be part of the
> public interface, is not currently called from outside tmp_objdir.c.
> Despite being unlikely, it is at least plausible that this function
> may be useful in future. ;-) ]

Yeah, builtin/receive-pack is happy to just rely on process death to
destroy it, but I think it's good to keep open an option for somebody to
do:

  if (error) {
	tmp_objdir_destroy(t);
	return -1;
  }

or similar.

-Peff

```
