diff options
Diffstat (limited to 'firmware/common/file.c')
-rw-r--r-- | firmware/common/file.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c index b4b879f8fb..f81038fa77 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c | |||
@@ -52,7 +52,7 @@ static struct filedesc openfiles[MAX_OPEN_FILES]; | |||
52 | 52 | ||
53 | static int flush_cache(int fd); | 53 | static int flush_cache(int fd); |
54 | 54 | ||
55 | int creat(const char *pathname, int mode) | 55 | int creat(const char *pathname, mode_t mode) |
56 | { | 56 | { |
57 | (void)mode; | 57 | (void)mode; |
58 | return open(pathname, O_WRONLY|O_CREAT|O_TRUNC); | 58 | return open(pathname, O_WRONLY|O_CREAT|O_TRUNC); |
@@ -307,7 +307,7 @@ int rename(const char* path, const char* newpath) | |||
307 | return 0; | 307 | return 0; |
308 | } | 308 | } |
309 | 309 | ||
310 | int ftruncate(int fd, unsigned int size) | 310 | int ftruncate(int fd, off_t size) |
311 | { | 311 | { |
312 | int rc, sector; | 312 | int rc, sector; |
313 | struct filedesc* file = &openfiles[fd]; | 313 | struct filedesc* file = &openfiles[fd]; |
@@ -513,22 +513,22 @@ static int readwrite(int fd, void* buf, int count, bool write) | |||
513 | return nread; | 513 | return nread; |
514 | } | 514 | } |
515 | 515 | ||
516 | int write(int fd, void* buf, int count) | 516 | ssize_t write(int fd, const void* buf, size_t count) |
517 | { | 517 | { |
518 | if (!openfiles[fd].write) { | 518 | if (!openfiles[fd].write) { |
519 | errno = EACCES; | 519 | errno = EACCES; |
520 | return -1; | 520 | return -1; |
521 | } | 521 | } |
522 | return readwrite(fd, buf, count, true); | 522 | return readwrite(fd, (void *)buf, count, true); |
523 | } | 523 | } |
524 | 524 | ||
525 | int read(int fd, void* buf, int count) | 525 | ssize_t read(int fd, void* buf, size_t count) |
526 | { | 526 | { |
527 | return readwrite(fd, buf, count, false); | 527 | return readwrite(fd, buf, count, false); |
528 | } | 528 | } |
529 | 529 | ||
530 | 530 | ||
531 | int lseek(int fd, int offset, int whence) | 531 | off_t lseek(int fd, off_t offset, int whence) |
532 | { | 532 | { |
533 | int pos; | 533 | int pos; |
534 | int newsector; | 534 | int newsector; |