X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fdrv%2Fvterm.c;h=fc6dea26487e2d95e897f05225349f15193581f2;hb=d0b4559f2936f6d9f06be0f7c3c51527a480ec0d;hp=a6a1c66d655d985d02a39bbe7b474bdc2ab9c780;hpb=fc56849d679ac766faa2441dd0ac0976f9ba3174;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/drv/vterm.c b/KernelLand/Kernel/drv/vterm.c index a6a1c66d..fc6dea26 100644 --- a/KernelLand/Kernel/drv/vterm.c +++ b/KernelLand/Kernel/drv/vterm.c @@ -34,7 +34,7 @@ extern void Debug_SetKTerminal(const char *File); // === PROTOTYPES === int VT_Install(char **Arguments); -char *VT_ReadDir(tVFS_Node *Node, int Pos); + int VT_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]); tVFS_Node *VT_FindDir(tVFS_Node *Node, const char *Name); int VT_Root_IOCtl(tVFS_Node *Node, int Id, void *Data); size_t VT_Read(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer); @@ -196,7 +196,6 @@ int VT_Install(char **Arguments) // Semaphore_Init(&gVT_Terminals[i].InputSemaphore, 0, MAX_INPUT_CHARS8, "VTerm", gVT_Terminals[i].Name); } - Log_Debug("VTerm", "Registering with DevFS"); // Add to DevFS DevFS_AddDevice( &gVT_DrvInfo ); @@ -269,11 +268,12 @@ void VT_SetResolution(int Width, int Height) * \fn char *VT_ReadDir(tVFS_Node *Node, int Pos) * \brief Read from the VTerm Directory */ -char *VT_ReadDir(tVFS_Node *Node, int Pos) +int VT_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]) { - if(Pos < 0) return NULL; - if(Pos >= NUM_VTS) return NULL; - return strdup( gVT_Terminals[Pos].Name ); + if(Pos < 0) return -EINVAL; + if(Pos >= NUM_VTS) return -EINVAL; + strncpy(Dest, gVT_Terminals[Pos].Name, FILENAME_MAX); + return 0; } /**