Add tostring to IPC results
This commit is contained in:
parent
3d534e8b18
commit
a736f0281b
1 changed files with 12 additions and 0 deletions
|
@ -42,6 +42,18 @@ ipc_eval(
|
||||||
kiwmi_command_send_done(
|
kiwmi_command_send_done(
|
||||||
command_resource, KIWMI_COMMAND_ERROR_SUCCESS, "");
|
command_resource, KIWMI_COMMAND_ERROR_SUCCESS, "");
|
||||||
} else {
|
} else {
|
||||||
|
lua_getglobal(L, "tostring");
|
||||||
|
lua_insert(L, -2);
|
||||||
|
|
||||||
|
if (lua_pcall(L, 1, 1, 0)) {
|
||||||
|
const char *error = lua_tostring(L, -1);
|
||||||
|
wlr_log(WLR_ERROR, "Error running IPC command: %s", error);
|
||||||
|
kiwmi_command_send_done(
|
||||||
|
command_resource, KIWMI_COMMAND_ERROR_FAILURE, error);
|
||||||
|
lua_pop(L, 1);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
kiwmi_command_send_done(
|
kiwmi_command_send_done(
|
||||||
command_resource, KIWMI_COMMAND_ERROR_SUCCESS, lua_tostring(L, -1));
|
command_resource, KIWMI_COMMAND_ERROR_SUCCESS, lua_tostring(L, -1));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue