diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2002-06-07 15:15:10 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2002-06-07 15:15:10 +0000 |
commit | 7fbdc3692d9987fe8e085f523d976a105ea77ac6 (patch) | |
tree | 0ac898d269abf3ccb71c6321d7a5f3371a23ca62 /firmware/common/file.c | |
parent | 04d6d8f14ffe74b30398f5745fd2afa946955b9d (diff) |
Added check for open-for-write
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@922 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/common/file.c')
-rw-r--r-- | firmware/common/file.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c index 38ae3cb912..27588f3597 100644 --- a/firmware/common/file.c +++ b/firmware/common/file.c @@ -54,6 +54,13 @@ int open(char* pathname, int flags) char* name; int namelen; + /* For now, we don't support writing */ + if(flags & (O_WRONLY | O_RDWR)) + { + errno = EROFS; + return -1; + } + if ( pathname[0] != '/' ) { DEBUGF("'%s' is not an absolute path.\n",pathname); DEBUGF("Only absolute pathnames supported at the moment\n"); |