X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=KernelLand%2FKernel%2Fdrv%2Fproc.c;h=03288aeaa475e81b4a53778fff118fe8baa38e7b;hb=2462d860630674d10d554f86aa669163f6f2db6b;hp=9c7d909ac3d94c9ebce7561aae294ddba5737eb9;hpb=d0b4559f2936f6d9f06be0f7c3c51527a480ec0d;p=tpg%2Facess2.git diff --git a/KernelLand/Kernel/drv/proc.c b/KernelLand/Kernel/drv/proc.c index 9c7d909a..03288aea 100644 --- a/KernelLand/Kernel/drv/proc.c +++ b/KernelLand/Kernel/drv/proc.c @@ -32,8 +32,8 @@ typedef struct sSysFS_Ent #endif int SysFS_Comm_ReadDir(tVFS_Node *Node, int Id, char Dest[FILENAME_MAX]); -tVFS_Node *SysFS_Comm_FindDir(tVFS_Node *Node, const char *Filename); -size_t SysFS_Comm_ReadFile(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer); +tVFS_Node *SysFS_Comm_FindDir(tVFS_Node *Node, const char *Filename, Uint Flags); +size_t SysFS_Comm_ReadFile(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer, Uint Flags); void SysFS_Comm_CloseFile(tVFS_Node *Node); // === GLOBALS === @@ -150,6 +150,10 @@ int SysFS_RegisterFile(const char *Path, const char *Data, int Length) if( !child ) { child = calloc( 1, sizeof(tSysFS_Ent)+tmp+1 ); + if( !child ) { + Log_Error("SysFS", "calloc(%i) failure", sizeof(tSysFS_Ent)+tmp+1); + return -1; + } child->Next = NULL; memcpy(child->Name, &Path[start], tmp); child->Name[tmp] = '\0'; @@ -174,7 +178,8 @@ int SysFS_RegisterFile(const char *Path, const char *Data, int Length) ent->Node.Size ++; else gSysFS_DriverInfo.RootNode.Size ++; - Log_Log("SysFS", "Added directory '%s'", child->Name); + Log_Log("SysFS", "Added directory '%.*s'", tmp, &Path[start]); + Log_Log("SysFS", "Added directory '%.*s'", tmp, child->Name); } ent = child; @@ -197,7 +202,7 @@ int SysFS_RegisterFile(const char *Path, const char *Data, int Length) break; } if( child ) { - Log_Warning("SysFS", "'%s' is taken (in '%s')\n", &Path[start], Path); + Log_Warning("SysFS", "'%s' is taken (in '%s')", &Path[start], Path); return 0; } @@ -356,7 +361,7 @@ int SysFS_Comm_ReadDir(tVFS_Node *Node, int Pos, char Dest[FILENAME_MAX]) * \fn tVFS_Node *SysFS_Comm_FindDir(tVFS_Node *Node, const char *Filename) * \brief Find a file in a SysFS directory */ -tVFS_Node *SysFS_Comm_FindDir(tVFS_Node *Node, const char *Filename) +tVFS_Node *SysFS_Comm_FindDir(tVFS_Node *Node, const char *Filename, Uint Flags) { tSysFS_Ent *child = (tSysFS_Ent*)Node->ImplPtr; @@ -372,7 +377,7 @@ tVFS_Node *SysFS_Comm_FindDir(tVFS_Node *Node, const char *Filename) /** * \brief Read from an exposed buffer */ -size_t SysFS_Comm_ReadFile(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer) +size_t SysFS_Comm_ReadFile(tVFS_Node *Node, off_t Offset, size_t Length, void *Buffer, Uint Flags) { if( Offset > Node->Size ) return -1; if( Length > Node->Size ) Length = Node->Size;