Add Beat's test
[yaffs/.git] / direct / yaffsfs.c
index ec7ccf5c8b3ef2325bf30d24e4b4ebd72b520402..efd5f8cc70fd0799d1e016b17dcf37ec23cc4a54 100644 (file)
@@ -25,7 +25,7 @@
 #endif
 
 
-const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.7 2004-11-21 23:33:30 charles Exp $";
+const char *yaffsfs_c_version="$Id: yaffsfs.c,v 1.8 2005-08-31 09:21:12 charles Exp $";
 
 // configurationList is the list of devices that are supported
 static yaffsfs_DeviceConfiguration *yaffsfs_configurationList;
@@ -410,19 +410,19 @@ int yaffs_open(const char *path, int oflag, int mode)
                        
                        // Check file permissions
                        if( (oflag & (O_RDWR | O_WRONLY)) == 0 &&     // ie O_RDONLY
-                          !(obj->st_mode & S_IREAD))
+                          !(obj->yst_mode & S_IREAD))
                        {
                                openDenied = 1;
                        }
 
                        if( (oflag & O_RDWR) && 
-                          !(obj->st_mode & S_IREAD))
+                          !(obj->yst_mode & S_IREAD))
                        {
                                openDenied = 1;
                        }
 
                        if( (oflag & (O_RDWR | O_WRONLY)) && 
-                          !(obj->st_mode & S_IWRITE))
+                          !(obj->yst_mode & S_IWRITE))
                        {
                                openDenied = 1;
                        }
@@ -805,33 +805,33 @@ static int yaffsfs_DoStat(yaffs_Object *obj,struct yaffs_stat *buf)
 
        if(obj && buf)
        {
-       buf->st_dev = (int)obj->myDev->genericDevice;
-       buf->st_ino = obj->objectId;
-       buf->st_mode = obj->st_mode & ~S_IFMT; // clear out file type bits
+       buf->yst_dev = (int)obj->myDev->genericDevice;
+       buf->yst_ino = obj->objectId;
+       buf->yst_mode = obj->yst_mode & ~S_IFMT; // clear out file type bits
        
                if(obj->variantType == YAFFS_OBJECT_TYPE_DIRECTORY) 
                {
-                       buf->st_mode |= S_IFDIR;
+                       buf->yst_mode |= S_IFDIR;
                }
                else if(obj->variantType == YAFFS_OBJECT_TYPE_SYMLINK) 
                {
-                       buf->st_mode |= S_IFLNK;
+                       buf->yst_mode |= S_IFLNK;
                }
                else if(obj->variantType == YAFFS_OBJECT_TYPE_FILE)
                {
-                       buf->st_mode |= S_IFREG;
+                       buf->yst_mode |= S_IFREG;
                }
                
-       buf->st_nlink = yaffs_GetObjectLinkCount(obj);
-       buf->st_uid = 0;    
-       buf->st_gid = 0;;     
-       buf->st_rdev = obj->st_rdev;
-       buf->st_size = yaffs_GetObjectFileLength(obj);
-               buf->st_blksize = YAFFS_BYTES_PER_CHUNK;
-       buf->st_blocks = (buf->st_size + YAFFS_BYTES_PER_CHUNK -1)/YAFFS_BYTES_PER_CHUNK;
-       buf->st_atime = obj->st_atime; 
-       buf->st_ctime = obj->st_ctime; 
-       buf->st_mtime = obj->st_mtime; 
+       buf->yst_nlink = yaffs_GetObjectLinkCount(obj);
+       buf->yst_uid = 0;    
+       buf->yst_gid = 0;;     
+       buf->yst_rdev = obj->yst_rdev;
+       buf->yst_size = yaffs_GetObjectFileLength(obj);
+               buf->yst_blksize = YAFFS_BYTES_PER_CHUNK;
+       buf->yst_blocks = (buf->yst_size + YAFFS_BYTES_PER_CHUNK -1)/YAFFS_BYTES_PER_CHUNK;
+       buf->yst_atime = obj->yst_atime; 
+       buf->yst_ctime = obj->yst_ctime; 
+       buf->yst_mtime = obj->yst_mtime; 
                retVal = 0;
        }
        return retVal;
@@ -912,7 +912,7 @@ static int yaffsfs_DoChMod(yaffs_Object *obj,mode_t mode)
        
        if(obj)
        {
-               obj->st_mode = mode;
+               obj->yst_mode = mode;
                obj->dirty = 1;
                result = yaffs_FlushFile(obj,0);
        }