From 7fbdc3692d9987fe8e085f523d976a105ea77ac6 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Fri, 7 Jun 2002 15:15:10 +0000 Subject: Added check for open-for-write git-svn-id: svn://svn.rockbox.org/rockbox/trunk@922 a1c6a512-1295-4272-9138-f99709370657 --- firmware/common/file.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'firmware') 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"); -- cgit v1.2.3