Merge branch 'master' of ssh://www.aleph1.co.uk/home/aleph1/git/yaffs2
authorCharles Manning <cdhmanning@gmail.com>
Tue, 16 Nov 2010 00:53:27 +0000 (13:53 +1300)
committerCharles Manning <cdhmanning@gmail.com>
Tue, 16 Nov 2010 00:53:27 +0000 (13:53 +1300)
direct/yaffsfs.c

index 15d5aeb7b0ed35911f3edb8ea12fc090636981a6..6622536c834e652826445ada9c76cc0cae764659 100644 (file)
@@ -1724,7 +1724,7 @@ int yaffs_access(const YCHAR *path, int amode)
        struct yaffs_obj *obj=NULL;
        struct yaffs_obj *dir=NULL;
 
-       int retval = 0;
+       int retval = -1;
 
        if(amode & ~(R_OK | W_OK | X_OK)){
                yaffsfs_SetError(-EINVAL);
@@ -1749,10 +1749,10 @@ int yaffs_access(const YCHAR *path, int amode)
                if((amode & X_OK) && !(obj->yst_mode & S_IEXEC))
                        access_ok = 0;
 
-               if(!access_ok) {
+               if(!access_ok)
                        yaffsfs_SetError(-EACCES);
-                       retval = -1;
-               }
+               else
+                       retval = 0;
        }
 
        yaffsfs_Unlock();