# HG changeset patch # User Matthew Wild # Date 1378164028 -3600 # Node ID 5cf1c08805fbd7ad06bcee919d04a7f9acf95b8b # Parent be997c6a69be0ffd330c3cadcb4b5f00fbf1299e# Parent c888f548876b7dc9735c713ed13df2730ba25696 Merge 0.9->trunk diff -r be997c6a69be -r 5cf1c08805fb core/configmanager.lua --- a/core/configmanager.lua Mon Sep 02 15:22:41 2013 +0100 +++ b/core/configmanager.lua Tue Sep 03 00:20:28 2013 +0100 @@ -77,7 +77,7 @@ local is_relative; if path_sep == "/" and path:sub(1,1) ~= "/" then is_relative = true; - elseif path_sep == "\\" and (path:sub(1,1) ~= "/" and (path:sub(2,3) ~= ":\\" or path:sub(2,3) ~= ":/")) then + elseif path_sep == "\\" and (path:sub(1,1) ~= "/" and (path:sub(2,3) ~= ":\\" and path:sub(2,3) ~= ":/")) then is_relative = true; end if is_relative then diff -r be997c6a69be -r 5cf1c08805fb util-src/net.c --- a/util-src/net.c Mon Sep 02 15:22:41 2013 +0100 +++ b/util-src/net.c Tue Sep 03 00:20:28 2013 +0100 @@ -42,8 +42,8 @@ const long ip4_linklocal = htonl(0xa9fe0000); /* 169.254.0.0 */ const long ip4_mask = htonl(0xffff0000); struct ifaddrs *addr = NULL, *a; +#endif int n = 1; -#endif int type = luaL_checkoption(L, 1, "both", type_strings); const char link_local = lua_toboolean(L, 2); /* defaults to 0 (false) */ const char ipv4 = (type == 0 || type == 1); @@ -92,6 +92,15 @@ } freeifaddrs(addr); +#else + if (ipv4) { + lua_pushstring(L, "0.0.0.0"); + lua_rawseti(L, -2, n++); + } + if (ipv6) { + lua_pushstring(L, "::"); + lua_rawseti(L, -2, n++); + } #endif return 1; } diff -r be997c6a69be -r 5cf1c08805fb util-src/pposix.c --- a/util-src/pposix.c Mon Sep 02 15:22:41 2013 +0100 +++ b/util-src/pposix.c Tue Sep 03 00:20:28 2013 +0100 @@ -36,7 +36,7 @@ #include "lauxlib.h" #include -#if defined(_GNU_SOURCE) +#if defined(__linux__) && defined(_GNU_SOURCE) #include #endif @@ -680,7 +680,7 @@ offset = luaL_checkinteger(L, 2); len = luaL_checkinteger(L, 3); -#if defined(_GNU_SOURCE) +#if defined(__linux__) && defined(_GNU_SOURCE) if(fallocate(fileno(f), FALLOC_FL_KEEP_SIZE, offset, len) == 0) { lua_pushboolean(L, 1); diff -r be997c6a69be -r 5cf1c08805fb util/set.lua --- a/util/set.lua Mon Sep 02 15:22:41 2013 +0100 +++ b/util/set.lua Tue Sep 03 00:20:28 2013 +0100 @@ -91,13 +91,13 @@ end function set:include(otherset) - for item in pairs(otherset) do + for item in otherset do items[item] = true; end end function set:exclude(otherset) - for item in pairs(otherset) do + for item in otherset do items[item] = nil; end end