X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;ds=sidebyside;f=util-src%2Fpposix.c;h=8ad167b72d25ad5d0e0c3f619207302c09d05c1f;hb=07c90d3e366f5e455724be1d744f788b5cb93771;hp=c0d1f5a29e891484c7fc93139efc0876b9450e88;hpb=c36630d8de110bbe7e237baa7d67ee604147b688;p=prosody.git diff --git a/util-src/pposix.c b/util-src/pposix.c index c0d1f5a2..8ad167b7 100644 --- a/util-src/pposix.c +++ b/util-src/pposix.c @@ -36,7 +36,7 @@ #include "lauxlib.h" #include -#if defined(_GNU_SOURCE) +#if defined(__linux__) && defined(_GNU_SOURCE) #include #endif @@ -491,7 +491,7 @@ int string2resource(const char *s) { return -1; } -int arg_to_rlimit(lua_State* L, int idx, rlim_t current) { +unsigned long int arg_to_rlimit(lua_State* L, int idx, rlim_t current) { switch(lua_type(L, idx)) { case LUA_TSTRING: if(strcmp(lua_tostring(L, idx), "unlimited") == 0) @@ -680,7 +680,7 @@ int lc_fallocate(lua_State* L) 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);