| 342 | } |
| 343 | |
| 344 | int opt_get_error(lua_State *L, p_socket ps) |
| 345 | { |
| 346 | int val = 0; |
| 347 | socklen_t len = sizeof(val); |
| 348 | if (getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *) &val, &len) < 0) { |
| 349 | lua_pushnil(L); |
| 350 | lua_pushliteral(L, "getsockopt failed"); |
| 351 | return 2; |
| 352 | } |
| 353 | lua_pushstring(L, socket_strerror(val)); |
| 354 | return 1; |
| 355 | } |
| 356 | |
| 357 | static int opt_setboolean(lua_State *L, p_socket ps, int level, int name) |
| 358 | { |
nothing calls this directly
no test coverage detected