summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/common/file.c6
-rw-r--r--firmware/include/file.h2
-rw-r--r--firmware/mpeg.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index 01279d4421..6f86b2f8da 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -183,7 +183,7 @@ int close(int fd)
183 return -2; 183 return -2;
184 } 184 }
185 if (file->write) { 185 if (file->write) {
186 rc = flush(fd); 186 rc = fsync(fd);
187 if (rc < 0) 187 if (rc < 0)
188 return rc * 10 - 3; 188 return rc * 10 - 3;
189 } 189 }
@@ -192,12 +192,12 @@ int close(int fd)
192 return 0; 192 return 0;
193} 193}
194 194
195int flush(int fd) 195int fsync(int fd)
196{ 196{
197 struct filedesc* file = &openfiles[fd]; 197 struct filedesc* file = &openfiles[fd];
198 int rc = 0; 198 int rc = 0;
199 199
200 LDEBUGF("flush(%d)\n", fd); 200 LDEBUGF("fsync(%d)\n", fd);
201 201
202 if (fd < 0 || fd > MAX_OPEN_FILES-1) { 202 if (fd < 0 || fd > MAX_OPEN_FILES-1) {
203 errno = EINVAL; 203 errno = EINVAL;
diff --git a/firmware/include/file.h b/firmware/include/file.h
index 1a2f8e55be..2ea74c2f5b 100644
--- a/firmware/include/file.h
+++ b/firmware/include/file.h
@@ -56,7 +56,7 @@ extern int remove(const char*);
56#ifndef SIMULATOR 56#ifndef SIMULATOR
57extern int open(const char* pathname, int flags); 57extern int open(const char* pathname, int flags);
58extern int close(int fd); 58extern int close(int fd);
59extern int flush(int fd); 59extern int fsync(int fd);
60extern int read(int fd, void* buf, int count); 60extern int read(int fd, void* buf, int count);
61extern int lseek(int fd, int offset, int whence); 61extern int lseek(int fd, int offset, int whence);
62extern int creat(const char *pathname, int mode); 62extern int creat(const char *pathname, int mode);
diff --git a/firmware/mpeg.c b/firmware/mpeg.c
index 57234fc886..5d4552397d 100644
--- a/firmware/mpeg.c
+++ b/firmware/mpeg.c
@@ -1975,7 +1975,7 @@ static void mpeg_thread(void)
1975 } 1975 }
1976 } 1976 }
1977 1977
1978 rc = flush(mpeg_file); 1978 rc = fsync(mpeg_file);
1979 if(rc < 0) 1979 if(rc < 0)
1980 panicf("rec fls: %d", rc); 1980 panicf("rec fls: %d", rc);
1981 1981