aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/drivers/ose
diff options
context:
space:
mode:
Diffstat (limited to 'erts/emulator/drivers/ose')
-rw-r--r--erts/emulator/drivers/ose/ose_efile.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/erts/emulator/drivers/ose/ose_efile.c b/erts/emulator/drivers/ose/ose_efile.c
index 8cd34a7bb0..fc255e11ef 100644
--- a/erts/emulator/drivers/ose/ose_efile.c
+++ b/erts/emulator/drivers/ose/ose_efile.c
@@ -33,8 +33,10 @@
#include "erl_efile.h"
/*#include <utime.h>*/
#ifdef HAVE_UNISTD_H
+#ifndef __OSE__
#include <unistd.h>
#endif
+#endif
#ifdef HAVE_SYS_UIO_H
#include <sys/types.h>
#include <sys/uio.h>
@@ -60,8 +62,11 @@
#endif
#ifdef __OSE__
+#include "unistd.h"
#include "sys/stat.h"
#include "dirent.h"
+#include "sys/time.h"
+#include "time.h"
#endif
/* Find a definition of MAXIOV, that is used in the code later. */
@@ -826,10 +831,8 @@ efile_truncate_file(Efile_error* errInfo, int *fd, int flags)
{
#ifndef NO_FTRUNCATE
off_t offset;
-
- return check_error((offset = lseek(*fd, 0, 1)) >= 0 &&
- ftruncate(*fd, offset) == 0 ? 1 : -1,
- errInfo);
+ return check_error((offset = lseek(*fd, 0, SEEK_CUR)) >= 0 &&
+ ftruncate(*fd, offset) == 0 ? 1 : -1, errInfo);
#else
return 1;
#endif