[svn-commits] mnicholson: branch mnicholson/asttest r193831 - /team/mnicholson/asttest/astt...
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon May 11 22:36:42 CDT 2009
Author: mnicholson
Date: Mon May 11 22:36:39 2009
New Revision: 193831
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=193831
Log:
fixed wait_asterisk()
Modified:
team/mnicholson/asttest/asttest/lua/astlib.c
Modified: team/mnicholson/asttest/asttest/lua/astlib.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/mnicholson/asttest/asttest/lua/astlib.c?view=diff&rev=193831&r1=193830&r2=193831
==============================================================================
--- team/mnicholson/asttest/asttest/lua/astlib.c (original)
+++ team/mnicholson/asttest/asttest/lua/astlib.c Mon May 11 22:36:39 2009
@@ -408,19 +408,24 @@
lua_pop(L, 1);
if (waitpid(pid, &status, 0) == -1) {
- if (WIFEXITED(status)) {
- lua_pushinteger(L, WEXITSTATUS(status));
- lua_pushnil(L);
- } else if (WIFSIGNALED(status)) {
- lua_pushnil(L);
- if (WCOREDUMP(status))
- lua_pushliteral(L, "core");
- else
- lua_pushinteger(L, WTERMSIG(status));
- } else {
- lua_pushliteral(L, "unknown error running waitpid for asterisk");
- return lua_error(L);
- }
+ /* waitpid failed */
+ lua_pushnil(L);
+ lua_pushliteral(L, "error");
+ return 2;
+ }
+
+ if (WIFEXITED(status)) {
+ lua_pushinteger(L, WEXITSTATUS(status));
+ lua_pushnil(L);
+ } else if (WIFSIGNALED(status)) {
+ lua_pushnil(L);
+ if (WCOREDUMP(status))
+ lua_pushliteral(L, "core");
+ else
+ lua_pushinteger(L, WTERMSIG(status));
+ } else {
+ lua_pushliteral(L, "unknown error running waitpid for asterisk");
+ return lua_error(L);
}
/* unset the pid */
More information about the svn-commits
mailing list