Skip to content

Commit

Permalink
Add a closedir() so we don't run out of fd's
Browse files Browse the repository at this point in the history
When using Maildir's, the sidebar would feast on filedescriptors, eventually
leading to a malfunctioning mutt.
  • Loading branch information
Ilias Van Peer committed Dec 10, 2011
1 parent 55e2922 commit aeb47ad
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions mutt-sidebar.patch
Expand Up @@ -58,7 +58,7 @@ index 8414a8b..ef14453 100644
+OP_SIDEBAR_PREV "go to previous mailbox"
+OP_SIDEBAR_OPEN "open hilighted mailbox"
diff --git a/buffy.c b/buffy.c
index fd54dd2..6748e9f 100644
index fd54dd2..90bf3e4 100644
--- a/buffy.c
+++ b/buffy.c
@@ -312,6 +312,10 @@ static int buffy_maildir_hasnew (BUFFY* mailbox)
Expand All @@ -83,7 +83,7 @@ index fd54dd2..6748e9f 100644
rc = 1;
break;
}
@@ -337,6 +343,32 @@ static int buffy_maildir_hasnew (BUFFY* mailbox)
@@ -337,6 +343,34 @@ static int buffy_maildir_hasnew (BUFFY* mailbox)

closedir (dirp);

Expand Down Expand Up @@ -112,11 +112,13 @@ index fd54dd2..6748e9f 100644
+ mailbox->msgcount++;
+ }
+ }
+
+ closedir (dirp);
+
return rc;
}

@@ -345,14 +377,33 @@ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
@@ -345,14 +379,33 @@ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
{
int rc = 0;
int statcheck;
Expand Down Expand Up @@ -151,7 +153,7 @@ index fd54dd2..6748e9f 100644
if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited)
{
rc = 1;
@@ -374,9 +425,11 @@ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
@@ -374,9 +427,11 @@ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
int mutt_buffy_check (int force)
{
BUFFY *tmp;
Expand All @@ -163,7 +165,7 @@ index fd54dd2..6748e9f 100644

sb.st_size=0;
contex_sb.st_dev=0;
@@ -456,6 +509,20 @@ int mutt_buffy_check (int force)
@@ -456,6 +511,20 @@ int mutt_buffy_check (int force)
case M_MH:
if ((tmp->new = mh_buffy (tmp->path)) > 0)
BuffyCount++;
Expand Down

0 comments on commit aeb47ad

Please sign in to comment.