From: John Hodge Date: Fri, 25 Sep 2009 13:59:55 +0000 (+0800) Subject: Removed debug from VFS_GetACL and VTerm, fixed DevFS not being a directory X-Git-Tag: rel0.06~500 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=6098f7e3a0a3247c9517f9b04be814d16a98a564;p=tpg%2Facess2.git Removed debug from VFS_GetACL and VTerm, fixed DevFS not being a directory --- diff --git a/Kernel/drv/vterm.c b/Kernel/drv/vterm.c index fef93d88..5f013ac8 100644 --- a/Kernel/drv/vterm.c +++ b/Kernel/drv/vterm.c @@ -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; diff --git a/Kernel/vfs/acls.c b/Kernel/vfs/acls.c index c0225caa..9c81c387 100644 --- a/Kernel/vfs/acls.c +++ b/Kernel/vfs/acls.c @@ -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; } diff --git a/Kernel/vfs/fs/devfs.c b/Kernel/vfs/fs/devfs.c index 25585095..f5f090df 100644 --- a/Kernel/vfs/fs/devfs.c +++ b/Kernel/vfs/fs/devfs.c @@ -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 diff --git a/Kernel/vfs/open.c b/Kernel/vfs/open.c index 64c65dbc..3ac3fa3d 100644 --- a/Kernel/vfs/open.c +++ b/Kernel/vfs/open.c @@ -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; } diff --git a/Usermode/Applications/CLIShell_src/main.c b/Usermode/Applications/CLIShell_src/main.c index f4d703cf..e806a537 100644 --- a/Usermode/Applications/CLIShell_src/main.c +++ b/Usermode/Applications/CLIShell_src/main.c @@ -31,7 +31,7 @@ struct { // ==== LOCAL VARIABLES ==== char gsCommandBuffer[1024]; -char *gsCurrentDirectory = "/"; +char *gsCurrentDirectory = NULL; char gsTmpBuffer[1024]; char **gasCommandHistory; int giLastCommand = 0; @@ -50,8 +50,19 @@ int main(int argc, char *argv[], char *envp[]) //Command_Clear(0, NULL); + { + char *tmp = getenv("CWD"); + if(tmp) { + gsCurrentDirectory = malloc(strlen(tmp)+1); + strcpy(gsCurrentDirectory, tmp); + } else { + gsCurrentDirectory = malloc(2); + strcpy(gsCurrentDirectory, "/"); + } + } + write(_stdout, 1, "\n"); - write(_stdout, 36, "Acess Shell Version 3\n"); + write(_stdout, 22, "Acess Shell Version 3\n"); write(_stdout, 2, "\n"); for(;;) { @@ -59,6 +70,7 @@ int main(int argc, char *argv[], char *envp[]) if(saArgs[0]) free(saArgs); if(!bCached) free(sCommandStr); bCached = 0; + write(_stdout, 1, "\n"); write(_stdout, strlen(gsCurrentDirectory), gsCurrentDirectory); write(_stdout, 3, "$ "); @@ -324,6 +336,8 @@ void Command_Cd(int argc, char **argv) return; } + free(gsCurrentDirectory); + gsCurrentDirectory = malloc(strlen(tmpPath)+1); strcpy(gsCurrentDirectory, tmpPath); }