From: Samir Benmendil Date: Sun, 12 Jan 2014 15:43:23 +0000 (+0100) Subject: conky: close filehandles X-Git-Url: https://git.rmz.io/dotfiles.git/commitdiff_plain/da22589319feab551bf9c515349d9302cfa41214?ds=sidebyside conky: close filehandles --- diff --git a/conky/functions.lua b/conky/functions.lua index 918914f..4f51702 100644 --- a/conky/functions.lua +++ b/conky/functions.lua @@ -49,6 +49,7 @@ function conky_mail() if line:sub(-3) == 'new' then local new = io.popen("find " .. line .. " -type f -not -name '.*' -printf a") cnt_new = string.len(new:read("*all")) + new:close() if cnt_new > 0 then boxes[acc][box]['cnt_new'] = string.format("${color e6db74}%5d${color}", cnt_new) else @@ -57,6 +58,7 @@ function conky_mail() elseif line:sub(-3) == 'cur' then local old = io.popen("find " .. line .. " -type f -not -name '*:2,*S*' -printf a") cnt_old = string.len(old:read("*all")) + old:close() if cnt_old > 0 then boxes[acc][box]['cnt_old'] = string.format("${color fd971f}%2d${color}", cnt_old) else @@ -64,6 +66,7 @@ function conky_mail() end end end + dirs:close() newmail = "" local accounts = {"gmail"}