From a71c5efd101fde50e6221a118c2b4b3310f0c410 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Tue, 25 Aug 2009 20:16:35 +0200 Subject: [PATCH] awful.util: pread return error Signed-off-by: Julien Danjou --- lib/awful/util.lua.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/awful/util.lua.in b/lib/awful/util.lua.in index 861a0e89..3c113978 100644 --- a/lib/awful/util.lua.in +++ b/lib/awful/util.lua.in @@ -11,7 +11,6 @@ local assert = assert local loadstring = loadstring local loadfile = loadfile local debug = debug -local print = print local pairs = pairs local ipairs = ipairs local type = type @@ -91,7 +90,7 @@ end --- Read a program output and returns its output as a string. -- @param cmd The command to run. --- @return A string with the program output. +-- @return A string with the program output, or the error if one occured. function pread(cmd) if cmd and cmd ~= "" then local f, err = io.popen(cmd, 'r') @@ -100,7 +99,7 @@ function pread(cmd) f:close() return s else - print(err) + return err end end end