[asterisk-commits] mnicholson: testsuite/asterisk/trunk r408 - /asterisk/trunk/asttest/lib/lua/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 18 12:05:05 CDT 2010


Author: mnicholson
Date: Fri Jun 18 12:05:01 2010
New Revision: 408

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=408
Log:
in asterisk:cli() read the output from asterisk before calling p:wait()

Modified:
    asterisk/trunk/asttest/lib/lua/astlib.lua

Modified: asterisk/trunk/asttest/lib/lua/astlib.lua
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/asttest/lib/lua/astlib.lua?view=diff&rev=408&r1=407&r2=408
==============================================================================
--- asterisk/trunk/asttest/lib/lua/astlib.lua (original)
+++ asterisk/trunk/asttest/lib/lua/astlib.lua Fri Jun 18 12:05:01 2010
@@ -104,6 +104,12 @@
 		"-C", self.asterisk_conf
 	)
 
+	-- note, at one point this read was done after the call to p:wait();
+	-- this may have caused the asterisk process servicing the CLI command
+	-- to receive a SIGPIPE.  Now it is done before waiting for the process
+	-- to exit.
+	local output = p.stdout:read("*a")
+
 	-- wait up to 5 minutes for the process to exit.  If the process does
 	-- not exit within 5 minutes, return a error.
 	local res, err = p:wait(300000)
@@ -111,7 +117,7 @@
 		return res, err
 	end
 
-	return p.stdout:read("*a")
+	return output
 end
 
 function asterisk:spawn()




More information about the asterisk-commits mailing list