--- sh.c +++ sh.c 2009-08-14 10:27:58.129901841 +0200 @@ -2153,6 +2153,7 @@ mailchk(void) while (readdir(mailbox)) mailcount++; + closedir(mailbox); if (mailcount == 0) continue;