threads / patch / 44197

patchtmp-objdir: mark some file local symbols static

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

## tl;dr

2 messages between Oct 1, 2016 and Oct 2, 2016. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Ramsay Jones· Oct 1, 2016, 23:07 UTC · lore
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(-)
Show changes to 2 files +2 −2

builtin/receive-pack.c, tmp-objdir.c

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· Oct 2, 2016, 12:13 UTC · re: Ramsay Jones · lore

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

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

← back to recent threads