diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luasocket.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/luasocket.c b/src/luasocket.c index bd3f473..96733b5 100644 --- a/src/luasocket.c +++ b/src/luasocket.c | |||
| @@ -1113,13 +1113,13 @@ static int set_option(lua_State *L, p_sock sock) | |||
| 1113 | lua_gettable(L, -2); | 1113 | lua_gettable(L, -2); |
| 1114 | if (!lua_isnumber(L, -1)) | 1114 | if (!lua_isnumber(L, -1)) |
| 1115 | lua_error(L, "invalid SO_LINGER (l_onoff) value"); | 1115 | lua_error(L, "invalid SO_LINGER (l_onoff) value"); |
| 1116 | linger.l_onoff = lua_tonumber(L, -1); | 1116 | linger.l_onoff = (int) lua_tonumber(L, -1); |
| 1117 | lua_pop(L, 1); | 1117 | lua_pop(L, 1); |
| 1118 | lua_pushstring(L, "l_linger"); | 1118 | lua_pushstring(L, "l_linger"); |
| 1119 | lua_gettable(L, -2); | 1119 | lua_gettable(L, -2); |
| 1120 | if (!lua_isnumber(L, -1)) | 1120 | if (!lua_isnumber(L, -1)) |
| 1121 | lua_error(L, "invalid SO_LINGER (l_linger) value"); | 1121 | lua_error(L, "invalid SO_LINGER (l_linger) value"); |
| 1122 | linger.l_linger = lua_tonumber(L, -1); | 1122 | linger.l_linger = (int) lua_tonumber(L, -1); |
| 1123 | lua_pop(L, 1); | 1123 | lua_pop(L, 1); |
| 1124 | err = setsockopt(sock->sock, SOL_SOCKET, SO_LINGER, | 1124 | err = setsockopt(sock->sock, SOL_SOCKET, SO_LINGER, |
| 1125 | (char *) &linger, sizeof(linger)); | 1125 | (char *) &linger, sizeof(linger)); |
