projects
/
project
/
luci.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nixio: FreeBSD compatibility #2
[project/luci.git]
/
libs
/
nixio
/
src
/
file.c
diff --git
a/libs/nixio/src/file.c
b/libs/nixio/src/file.c
index 5229b4988b448f79ca96ee78bf680d4a02c098ab..2fe00c2a821d569c461a080f7e4103dc1cde5a0f 100644
(file)
--- 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 <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/param.h>
static int nixio_open(lua_State *L) {
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);
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));
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) {
}
static int nixio_file_lock(lua_State *L) {