// === IMPORTS ===
extern tVFS_Node gVFS_MemRoot;
extern tVFS_Mount *gVFS_RootMount;
-
-extern tVFS_Handle *VFS_GetHandle(int FD);
extern int VFS_AllocHandle(int bIsUser, tVFS_Node *Node, int Mode);
// === CODE ===
char *tmpStr;
int iPos = 0;
int iPos2 = 0;
- char *chroot = CFGPTR(CFG_VFS_CHROOT);
+ const char *chroot = CFGPTR(CFG_VFS_CHROOT);
int chrootLen;
- char *cwd = CFGPTR(CFG_VFS_CWD);
+ const char *cwd = CFGPTR(CFG_VFS_CWD);
int cwdLen;
ENTER("sPath", Path);
if(Path[0] == '$') {
ret = malloc(strlen(Path)+1);
if(!ret) {
- Warning("VFS_GetAbsPath - malloc() returned NULL");
+ Log_Warning("VFS", "VFS_GetAbsPath: malloc() returned NULL");
return NULL;
}
strcpy(ret, Path);
if(Path[0] == '/') {
ret = malloc(pathLen + 1);
if(!ret) {
- Warning("VFS_GetAbsPath - malloc() returned NULL");
+ Log_Warning("VFS", "VFS_GetAbsPath: malloc() returned NULL");
return NULL;
}
strcpy(ret, Path);
strcpy(ret, cwd);
ret[cwdLen] = '/';
strcpy(&ret[cwdLen+1], Path);
- //Log("ret = '%s'\n", ret);
+ //Log("ret = '%s'", ret);
}
// Parse Path
}
i = VFS_AllocHandle( !!(Mode & VFS_OPENFLAG_USER), node, Mode );
- if( i > 0 ) {
+ if( i >= 0 ) {
LEAVE('x', i);
return i;
}
}
i = VFS_AllocHandle( !!(Mode & VFS_OPENFLAG_USER), node, Mode );
- if( i > 0 ) {
+ if( i >= 0 ) {
LEAVE('x', i);
return i;
}
// Get handle
h = VFS_GetHandle(FD);
if(h == NULL) {
- Log_Warning("VFS", "Invalid file handle passed to VFS_Close, 0x%x\n", FD);
+ Log_Warning("VFS", "Invalid file handle passed to VFS_Close, 0x%x", FD);
return;
}
/**
* \brief Change current working directory
*/
-int VFS_ChDir(char *Dest)
+int VFS_ChDir(const char *Dest)
{
char *buf;
int fd;
* \fn int VFS_ChRoot(char *New)
* \brief Change current root directory
*/
-int VFS_ChRoot(char *New)
+int VFS_ChRoot(const char *New)
{
char *buf;
int fd;