Removed debug from VFS_GetACL and VTerm, fixed DevFS not being a directory
authorJohn Hodge <[email protected]>
Fri, 25 Sep 2009 13:59:55 +0000 (21:59 +0800)
committerJohn Hodge <[email protected]>
Fri, 25 Sep 2009 13:59:55 +0000 (21:59 +0800)
Kernel/drv/vterm.c
Kernel/vfs/acls.c
Kernel/vfs/fs/devfs.c
Kernel/vfs/open.c
Usermode/Applications/CLIShell_src/main.c

index fef93d8..5f013ac 100644 (file)
@@ -62,7 +62,7 @@ void  VT_int_UpdateScreen( tVTerm *Term, int UpdateAll );
 
 // === CONSTANTS ===
 const Uint16   caVT100Colours[] = {
-               VT_COL_BLACK, 0x700, 0x070, 0x770, 0x007, 0x707, 0x077, VT_COL_LTGREY,
+               VT_COL_BLACK, 0x700, 0x070, 0x770, 0x007, 0x707, 0x077, 0x777,
                VT_COL_GREY, 0xF00, 0x0F0, 0xFF0, 0x00F, 0xF0F, 0x0FF, VT_COL_WHITE
        };
 
@@ -473,7 +473,6 @@ void VT_int_PutChar(tVTerm *Term, Uint32 Ch)
        {
        case 0: return; // Ignore NULL byte
        case '\n':
-               LOG("%i += %i", Term->WritePos, Term->Width);
                Term->WritePos += Term->Width;
        case '\r':
                Term->WritePos -= Term->WritePos % Term->Width;
index c0225ca..9c81c38 100644 (file)
@@ -64,21 +64,15 @@ int VFS_GetACL(int FD, tVFS_ACL *Dest)
         int    i;
        tVFS_Handle     *h = VFS_GetHandle(FD);
        
-       ENTER("ph pDest", h, Dest);
-       
        // Error check
        if(!h) {
-               LEAVE('i', -1);
                return -1;
        }
        
-       LOG("h->Node = %p", h->Node);
-       
        // Root can do anything
        if(Dest->Group == 0 && Dest->ID == 0) {
                Dest->Inv = 0;
                Dest->Perms = -1;
-               LEAVE('i', 1);
                return 1;
        }
        
@@ -86,7 +80,6 @@ int VFS_GetACL(int FD, tVFS_ACL *Dest)
        if( h->Node->NumACLs == 0 ) {
                Dest->Inv = 0;
                Dest->Perms = 0;
-               LEAVE('i', 0);
                return 0;
        }
        
@@ -98,13 +91,11 @@ int VFS_GetACL(int FD, tVFS_ACL *Dest)
                
                Dest->Inv = h->Node->ACLs[i].Inv;
                Dest->Perms = h->Node->ACLs[i].Perms;
-               LEAVE('i', 1);
                return 1;
        }
        
        
        Dest->Inv = 0;
        Dest->Perms = 0;
-       LEAVE('i', 0);
        return 0;
 }
index 2558509..f5f090d 100644 (file)
@@ -19,6 +19,7 @@ tVFS_Driver   gDevFS_Info = {
        };
 tVFS_Node      gDevFS_RootNode = {
        .NumACLs = 1,
+       .Flags = VFS_FFLAG_DIRECTORY,
        .ACLs = &gVFS_ACL_EveryoneRW,
        .ReadDir = DevFS_ReadDir,
        .FindDir = DevFS_FindDir
index 64c65db..3ac3fa3 100644 (file)
@@ -392,7 +392,7 @@ int VFS_Open(char *Path, Uint Mode)
        if( !(Mode & VFS_OPENFLAG_NOLINK) && (node->Flags & VFS_FFLAG_SYMLINK) )
        {
                if( !node->Read ) {
-                       LOG("No read method on symlink");
+                       Warning("No read method on symlink");
                        LEAVE('i', -1);
                        return -1;
                }
index f4d703c..e806a53 100644 (file)
@@ -31,7 +31,7 @@ struct        {
 \r
 // ==== LOCAL VARIABLES ====\r
 char   gsCommandBuffer[1024];\r
-char   *gsCurrentDirectory = "/";\r
+char   *gsCurrentDirectory = NULL;\r
 char   gsTmpBuffer[1024];\r
 char   **gasCommandHistory;\r
  int   giLastCommand = 0;\r
@@ -50,8 +50,19 @@ int main(int argc, char *argv[], char *envp[])
        \r
        //Command_Clear(0, NULL);\r
        \r
+       {\r
+               char    *tmp = getenv("CWD");\r
+               if(tmp) {\r
+                       gsCurrentDirectory = malloc(strlen(tmp)+1);\r
+                       strcpy(gsCurrentDirectory, tmp);\r
+               } else {\r
+                       gsCurrentDirectory = malloc(2);\r
+                       strcpy(gsCurrentDirectory, "/");\r
+               }\r
+       }       \r
+       \r
        write(_stdout, 1, "\n");\r
-       write(_stdout, 36, "Acess Shell Version 3\n");\r
+       write(_stdout, 22, "Acess Shell Version 3\n");\r
        write(_stdout,  2, "\n");\r
        for(;;)\r
        {\r
@@ -59,6 +70,7 @@ int main(int argc, char *argv[], char *envp[])
                if(saArgs[0])   free(saArgs);\r
                if(!bCached)    free(sCommandStr);\r
                bCached = 0;\r
+               write(_stdout, 1, "\n");\r
                write(_stdout, strlen(gsCurrentDirectory), gsCurrentDirectory);\r
                write(_stdout, 3, "$ ");\r
                \r
@@ -324,6 +336,8 @@ void Command_Cd(int argc, char **argv)
                return;\r
        }\r
        \r
+       free(gsCurrentDirectory);\r
+       gsCurrentDirectory = malloc(strlen(tmpPath)+1);\r
        strcpy(gsCurrentDirectory, tmpPath);\r
 }\r
 \r

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