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 | |
parent | 04d6d8f14ffe74b30398f5745fd2afa946955b9d (diff) | |
download | rockbox-7fbdc3692d9987fe8e085f523d976a105ea77ac6.tar.gz rockbox-7fbdc3692d9987fe8e085f523d976a105ea77ac6.zip |
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')
-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) | |||
54 | char* name; | 54 | char* name; |
55 | int namelen; | 55 | int namelen; |
56 | 56 | ||
57 | /* For now, we don't support writing */ | ||
58 | if(flags & (O_WRONLY | O_RDWR)) | ||
59 | { | ||
60 | errno = EROFS; | ||
61 | return -1; | ||
62 | } | ||
63 | |||
57 | if ( pathname[0] != '/' ) { | 64 | if ( pathname[0] != '/' ) { |
58 | DEBUGF("'%s' is not an absolute path.\n",pathname); | 65 | DEBUGF("'%s' is not an absolute path.\n",pathname); |
59 | DEBUGF("Only absolute pathnames supported at the moment\n"); | 66 | DEBUGF("Only absolute pathnames supported at the moment\n"); |