same for js_system
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16831 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
474ca2a9bd
commit
d66fb0f09c
|
@ -3525,10 +3525,14 @@ static JSBool js_bridge(JSContext * cx, JSObject * obj, uintN argc, jsval * argv
|
|||
static JSBool js_system(JSContext * cx, JSObject * obj, uintN argc, jsval * argv, jsval * rval)
|
||||
{
|
||||
char *cmd;
|
||||
int saveDepth, result;
|
||||
*rval = BOOLEAN_TO_JSVAL(JS_FALSE);
|
||||
|
||||
if (argc > 0 && (cmd = JS_GetStringBytes(JS_ValueToString(cx, argv[0])))) {
|
||||
*rval = INT_TO_JSVAL(switch_system(cmd, SWITCH_TRUE));
|
||||
saveDepth = JS_SuspendRequest(cx);
|
||||
result = switch_system(cmd, SWITCH_TRUE);
|
||||
JS_ResumeRequest(cx, saveDepth);
|
||||
*rval = INT_TO_JSVAL(result);
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue