git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] dir.c: mark a file local function as static

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Oct 30, 2014, 16:01 UTC
Message-ID
<545260EA.7050903@ramsay1.demon.co.uk>

Commit b74884b86 ("untracked cache: make a wrapper around {open,read,close}dir()", 27-10-2014) added the read_cached_dir() function as an external symbol.

Noticed by sparse. ("'read_cached_dir' was not declared. Should it be static?").

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
Hi Duy,

If you need to re-roll your 'nd/untracked-cache' branch, could you please squash this into the relevant patch.

Thanks!

[If this function is destined to be used from external call sites in future patches, then adding an extern declaration to "dir.h" would be an alternative, of course. ;-) ]

ATB, Ramsay Jones

 dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dir.c b/dir.c
index 0040ca1..e999cc8 100644
--- a/dir.c
+++ b/dir.c
@@ -1582,7 +1582,7 @@ static int open_cached_dir(struct cached_dir *cdir,
 	return 0;
 }
 
-int read_cached_dir(struct cached_dir *cdir)
+static int read_cached_dir(struct cached_dir *cdir)
 {
 	if (cdir->fdir) {
 		cdir->de = readdir(cdir->fdir);
-- 
2.1.0
Message 1 of 1 in “dir.c: mark a file local function as static”
  1. dir.c: mark a file local function as staticRamsay Jones, Oct 30, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.