Changeset

5812:57ebf93ec720

util.pposix: Fix building on non-Linux with glibc
author Kim Alvefur <zash@zash.se>
date Mon, 02 Sep 2013 18:19:38 +0200
parents 5811:27ae988f5b70
children 5813:c888f548876b
files util-src/pposix.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);