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

[PATCH 1/2] modified dir-iterator.c

From
Ssushmaunnibhavi <sushmaunnibhavi425@gmail.com>
Date
Mar 8, 2019, 13:06 UTC
Message-ID
<20190308130605.GA20220@hacker-queen>

--- Some places in git use raw API opendir/readdir/closedir to traverse a directory recursively, which usually involves function recursion. Now that we have struct dir_iterator,we have to convert these to use the dir-iterator to simplify the code.

Signed-off-by: Sushma Unnibhavi <sushmaunnibhavi425@gmail.com>
 dir-iterator.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dir-iterator.c b/dir-iterator.c
index f2dcd82fde..a3b5b8929c 100644
--- a/dir-iterator.c
+++ b/dir-iterator.c
@@ -169,7 +169,7 @@ int dir_iterator_abort(struct dir_iterator *dir_iterator)
 		struct dir_iterator_level *level =
 			&iter->levels[iter->levels_nr - 1];
 
-		if (level->dir && closedir(level->dir)) {
+		if (level->dir && (struct dir_iterator_int *)(level->dir)) {//changed closedir to (struct dir_iterator_int *)
 			strbuf_setlen(&iter->base.path, level->prefix_len);
 			warning("error closing directory %s: %s",
 				iter->base.path.buf, strerror(errno));
-- 
2.17.1
Message 1 of 1 in “modified dir-iterator.c”
  1. 1/2 modified dir-iterator.csushmaunnibhavi, Mar 8, 2019

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.