diff options
Diffstat (limited to 'l_cmd.c')
-rw-r--r-- | l_cmd.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -122,7 +122,17 @@ static int l_cmd_recv_data(lua_State* L) static int l_cmd_send_string(lua_State* L) { - return 0; + int ret = send_string(cmd_fd, luaL_checkstring(L,1)); + if (ret > 0) + do { + ret = write(cmd_fd, "\n", 1); + } while(!ret || (ret == -1 && errno == EINTR)); + + if(ret > 0) + ret = 0; + + lua_pushinteger(L, ret); + return 1; } static const struct luaL_reg cmd_funcs [] = { |