Mirror von
https://github.com/tkuschel/bees.git
synchronisiert 2026-05-08 04:59:37 +02:00
context: cache result of home_fd()
BeesContext::home_fd() is supposed to open $BEESHOME once and cache the Fd for later calls; however, instead it was reopening a new Fd each time it was called, and _also_ holding that Fd in a BeesContext member. Fds clean themselves up when they are forgotten, so it was not leaking per se, but it certainly had more open Fds than it needed to. Check to see if we have m_home_fd open, and return that if so. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
Dieser Commit ist enthalten in:
@@ -150,6 +150,10 @@ BeesContext::show_progress()
|
||||
Fd
|
||||
BeesContext::home_fd()
|
||||
{
|
||||
if (!!m_home_fd) {
|
||||
return m_home_fd;
|
||||
}
|
||||
|
||||
const char *base_dir = getenv("BEESHOME");
|
||||
if (!base_dir) {
|
||||
base_dir = ".beeshome";
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren