diff options
author | Steven Barth <steven@midlink.org> | 2009-03-12 14:53:52 +0000 |
---|---|---|
committer | Steven Barth <steven@midlink.org> | 2009-03-12 14:53:52 +0000 |
commit | 04eb9de74e06b8532fcb54986442ef8a5497c0ec (patch) | |
tree | 99f1eab559ef5016f8a271f20afa854d3c1f2424 /libs/nixio/src/file.c | |
parent | 35f40376c36805c4a023015d4cf95f1fa8adcb04 (diff) |
nixio: FreeBSD compatibility #2
Diffstat (limited to 'libs/nixio/src/file.c')
-rw-r--r-- | libs/nixio/src/file.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/nixio/src/file.c b/libs/nixio/src/file.c index 5229b4988b..2fe00c2a82 100644 --- a/libs/nixio/src/file.c +++ b/libs/nixio/src/file.c @@ -25,6 +25,7 @@ #include <fcntl.h> #include <sys/types.h> #include <sys/stat.h> +#include <sys/param.h> static int nixio_open(lua_State *L) { @@ -209,8 +210,12 @@ static int nixio_file_tell(lua_State *L) { static int nixio_file_sync(lua_State *L) { int fd = nixio__checkfd(L, 1); +#ifndef BSD int meta = lua_toboolean(L, 2); return nixio__pstatus(L, (meta) ? !fsync(fd) : !fdatasync(fd)); +#else + return nixio__pstatus(L, !fsync(fd)); +#endif } static int nixio_file_lock(lua_State *L) { |