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

[PATCH] builtin-clone.c: Need to closedir() in copy_or_link_directory()

From
drafnel@gmail.com <drafnel@gmail.com>
Date
May 18, 2008, 04:00 UTC
Message-ID
<3926741.1211083121329.JavaMail.teamon@b306.teamon.com>
In-Reply-To
<1211083201-2696-1-git-send-email-foo@example.com>
From: Brandon Casey <drafnel@gmail.com>
So not to leak file descriptors, close the directory after opening it.
Signed-off-by: Brandon Casey <drafnel@gmail.com>
---
 builtin-clone.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/builtin-clone.c b/builtin-clone.c
index 8713128..8936a51 100644
--- a/builtin-clone.c
+++ b/builtin-clone.c
@@ -215,6 +215,7 @@ static void copy_or_link_directory(char *src, char *dest)
 				die("failed to create link %s\n", dest);
 		}
 	}
+	closedir(dir);
 }
 
 static const struct ref *clone_local(const char *src_repo,
-- 
1.5.5.1.447.geb0a7
Message 1 of 1 in “builtin-clone.c: Need to closedir() in copy_or_link_directory()”
  1. builtin-clone.c: Need to closedir() in copy_or_link_directory()drafnel@gmail.com, May 18, 2008

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.