diff options
author | leso-kn <info@lesosoftware.com> | 2023-10-27 11:34:39 +0200 |
---|---|---|
committer | leso-kn <info@lesosoftware.com> | 2023-10-27 11:34:39 +0200 |
commit | 708e50f8e640540198a24798b1bacd349f3c11dd (patch) | |
tree | 84ed21b2ad878d208cebe406ab50ed5b2a957723 | |
parent | 0bc8c56043e9fee5403516c62618b7d3acc5508a (diff) | |
download | luasocket-708e50f8e640540198a24798b1bacd349f3c11dd.tar.gz luasocket-708e50f8e640540198a24798b1bacd349f3c11dd.tar.bz2 luasocket-708e50f8e640540198a24798b1bacd349f3c11dd.zip |
refactor(core): Replace check for SO_BINDTODEVICE support with platform independent version
-rw-r--r-- | src/options.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/options.c b/src/options.c index 6581cae..9dea6bd 100644 --- a/src/options.c +++ b/src/options.c | |||
@@ -58,7 +58,7 @@ int opt_meth_getoption(lua_State *L, p_opt opt, p_socket ps) | |||
58 | /* binds socket to network interface */ | 58 | /* binds socket to network interface */ |
59 | int opt_set_bindtodevice(lua_State *L, p_socket ps) | 59 | int opt_set_bindtodevice(lua_State *L, p_socket ps) |
60 | { | 60 | { |
61 | #if defined(__APPLE__) || defined(__WIN32__) || defined(_MSC_VER) | 61 | #ifndef SO_BINDTODEVICE |
62 | return luaL_error(L, "SO_BINDTODEVICE is not supported on this operating system"); | 62 | return luaL_error(L, "SO_BINDTODEVICE is not supported on this operating system"); |
63 | #else | 63 | #else |
64 | const char *dev = luaL_checkstring(L, 3); | 64 | const char *dev = luaL_checkstring(L, 3); |
@@ -68,7 +68,7 @@ int opt_set_bindtodevice(lua_State *L, p_socket ps) | |||
68 | 68 | ||
69 | int opt_get_bindtodevice(lua_State *L, p_socket ps) | 69 | int opt_get_bindtodevice(lua_State *L, p_socket ps) |
70 | { | 70 | { |
71 | #if defined(__APPLE__) || defined(__WIN32__) || defined(_MSC_VER) | 71 | #ifndef SO_BINDTODEVICE |
72 | return luaL_error(L, "SO_BINDTODEVICE is not supported on this operating system"); | 72 | return luaL_error(L, "SO_BINDTODEVICE is not supported on this operating system"); |
73 | #else | 73 | #else |
74 | char dev[IFNAMSIZ]; | 74 | char dev[IFNAMSIZ]; |