# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1378138778 -7200
# Node ID 57ebf93ec72008bfa1cdc820b70ab5fe7fe08091
# Parent  27ae988f5b70b45c220eba03d4e1e883c4e1c2fc
util.pposix: Fix building on non-Linux with glibc

diff -r 27ae988f5b70 -r 57ebf93ec720 util-src/pposix.c
--- a/util-src/pposix.c	Fri Aug 30 18:51:55 2013 +0200
+++ b/util-src/pposix.c	Mon Sep 02 18:19:38 2013 +0200
@@ -36,7 +36,7 @@
 #include "lauxlib.h"
 
 #include <fcntl.h>
-#if defined(_GNU_SOURCE)
+#if defined(__linux__) && defined(_GNU_SOURCE)
 #include <linux/falloc.h>
 #endif
 
@@ -670,7 +670,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);