Merge branch 'master' of git.mutabah.net:acess2
[tpg/acess2.git] / KernelLand / Kernel / vfs / fs / root.c
index 4416750..abe5945 100644 (file)
@@ -22,7 +22,8 @@ tRamFS_File   *Root_int_AllocFile(void);
 
 // === GLOBALS ===
 tVFS_Driver    gRootFS_Info = {
-       "rootfs", 0, Root_InitDevice, NULL, NULL
+       .Name = "rootfs", 
+       .InitDevice = Root_InitDevice
        };
 tRamFS_File    RootFS_Files[MAX_FILES];
 tVFS_ACL       RootFS_DirACLs[3] = {
@@ -71,6 +72,7 @@ tVFS_Node *Root_InitDevice(const char *Device, const char **Options)
        root->Node.NumACLs = 3;
        root->Node.ACLs = RootFS_DirACLs;
 
+       root->Node.Flags = VFS_FFLAG_DIRECTORY;
        root->Node.Type = &gRootFS_DirType;
        
        return &root->Node;
@@ -90,15 +92,15 @@ int Root_MkNod(tVFS_Node *Node, const char *Name, Uint Flags)
        
        LOG("Sanity check name length - %i > %i", strlen(Name)+1, sizeof(child->Name));
        if(strlen(Name) + 1 > sizeof(child->Name))
-               LEAVE_RET('i', 0);
+               LEAVE_RET('i', EINVAL);
        
        // Find last child, while we're at it, check for duplication
        for( child = parent->Data.FirstChild; child; prev = child, child = child->Next )
        {
                if(strcmp(child->Name, Name) == 0) {
                        LOG("Duplicate");
-                       LEAVE('i', 0);
-                       return 0;
+                       LEAVE('i', EEXIST);
+                       return EEXIST;
                }
        }
        
@@ -137,8 +139,8 @@ int Root_MkNod(tVFS_Node *Node, const char *Name, Uint Flags)
        
        parent->Node.Size ++;
        
-       LEAVE('i', 1);
-       return 1;
+       LEAVE('i', EOK);
+       return EOK;
 }
 
 /**

UCC git Repository :: git.ucc.asn.au