summaryrefslogtreecommitdiffstatshomepage
path: root/unix/file.c
diff options
context:
space:
mode:
authorblmorris <bryan.morrissey@gmail.com>2014-07-21 12:50:10 -0400
committerblmorris <bryan.morrissey@gmail.com>2014-07-21 12:50:10 -0400
commit721d6240c951d7f38289fdfb702536dfa155fdd8 (patch)
tree84ba9fba1218648f73f38346b30ad847437d3046 /unix/file.c
parentef204733d6abc31b09e4e7823d4665fafebd87ed (diff)
parent4038f513ea0a6be75ecbc4d8ab2bbe2349524bca (diff)
downloadmicropython-721d6240c951d7f38289fdfb702536dfa155fdd8.tar.gz
micropython-721d6240c951d7f38289fdfb702536dfa155fdd8.zip
Merge https://github.com/blmorris/micropython into Myriad2
Diffstat (limited to 'unix/file.c')
-rw-r--r--unix/file.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/unix/file.c b/unix/file.c
index 056a7b6e84..7cf0a51932 100644
--- a/unix/file.c
+++ b/unix/file.c
@@ -39,6 +39,10 @@
#include "runtime.h"
#include "stream.h"
+#ifdef _WIN32
+#define fsync _commit
+#endif
+
typedef struct _mp_obj_fdfile_t {
mp_obj_base_t base;
int fd;
@@ -83,12 +87,9 @@ STATIC mp_int_t fdfile_write(mp_obj_t o_in, const void *buf, mp_uint_t size, int
}
STATIC mp_obj_t fdfile_flush(mp_obj_t self_in) {
-#ifndef _WIN32
mp_obj_fdfile_t *self = self_in;
+ check_fd_is_open(self);
fsync(self->fd);
-#else
- //TODO
-#endif
return mp_const_none;
}
STATIC MP_DEFINE_CONST_FUN_OBJ_1(fdfile_flush_obj, fdfile_flush);