diff options
| author | Frank Gevaerts <frank@gevaerts.be> | 2009-12-23 22:13:37 +0000 |
|---|---|---|
| committer | Frank Gevaerts <frank@gevaerts.be> | 2009-12-23 22:13:37 +0000 |
| commit | 5509372f03e01235d4663d80bb769c52711688a9 (patch) | |
| tree | 0266542d402b3e8c6bf2023f127bbeb225ddedc9 | |
| parent | e0263b166c8e334c388655373f2144d9bc5184b4 (diff) | |
| download | rockbox-5509372f03e01235d4663d80bb769c52711688a9.zip rockbox-5509372f03e01235d4663d80bb769c52711688a9.tar.gz rockbox-5509372f03e01235d4663d80bb769c52711688a9.tar.bz2 rockbox-5509372f03e01235d4663d80bb769c52711688a9.tar.xz | |
Make read() and write() return -1/EISDIR on directories
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24106 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | firmware/common/file.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c index 75adc87..a80aed5 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c @@ -500,6 +500,11 @@ static int readwrite(int fd, void* buf, long count, bool write) return -1; } + if(file->attr & FAT_ATTR_DIRECTORY) { + errno = EISDIR; + return -1; + } + LDEBUGF( "readwrite(%d,%lx,%ld,%s)\n", fd,(long)buf,count,write?"write":"read"); |