------------------------------------------------------*/
| 333 | |
| 334 | /*------------------------------------------------------*/ |
| 335 | int opt_get_error(lua_State *L, p_socket ps) |
| 336 | { |
| 337 | int val = 0; |
| 338 | socklen_t len = sizeof(val); |
| 339 | if (getsockopt(*ps, SOL_SOCKET, SO_ERROR, (char *) &val, &len) < 0) { |
| 340 | lua_pushnil(L); |
| 341 | lua_pushstring(L, "getsockopt failed"); |
| 342 | return 2; |
| 343 | } |
| 344 | lua_pushstring(L, socket_strerror(val)); |
| 345 | return 1; |
| 346 | } |
| 347 | |
| 348 | /*=========================================================================*\ |
| 349 | * Auxiliar functions |
nothing calls this directly
no test coverage detected