diff --git a/src/sys/vfs/file.c b/src/sys/vfs/file.c index cafe6c1..58e4403 100644 --- a/src/sys/vfs/file.c +++ b/src/sys/vfs/file.c @@ -289,7 +289,8 @@ path = strtok(NULL,"\n"); } else { - path = &fileName; + path = fileName; + //path = &fileName; } if (path[0] == '/') { @@ -344,7 +345,7 @@ /* in order to save resources we will allocate the buffer later when it is needed */ -/* + tmpFd->buffer = (char *)kmalloc(4096); if(tmpFd->buffer == 0x0) { @@ -353,7 +354,7 @@ spinUnlock(&fdTable_lock); return 0x1; } -*/ + /* Set Its Status To Open */ tmpFd->status = fdOpen; @@ -415,8 +416,11 @@ if (tmpFd == fdTable) fdTable = tmpFd->next; + + systemVitals->openFiles--; spinUnlock(&fdTable_lock); - kfree(tmpFd->buffer); + if(tmpFd->buffer != NULL) + kfree(tmpFd->buffer); kfree(tmpFd); return(0x0); } diff --git a/src/sys/vfs/mount.c b/src/sys/vfs/mount.c index 7967ab4..7aee310 100644 --- a/src/sys/vfs/mount.c +++ b/src/sys/vfs/mount.c @@ -50,7 +50,7 @@ /* Allocate Memory For Mount Point */ if ((mp = (vfs_mountPoint_t *)kmalloc(sizeof(vfs_mountPoint_t))) == 0x0) - kpanic("vfs_mount: failed to allocate mp\n"); + kprintf("vfs_mount: failed to allocate mp\n"); /* Copy Mount Point Into Buffer */ sprintf(mp->mountPoint,mountPoint); @@ -136,11 +136,14 @@ } } /* Return NULL If Mount Point Not Found */ - return(0x0); + return NULL; } /*** $Log$ + Revision 1.11 2004/07/27 12:02:01 reddawg + chg: fixed marks bug readFile did a lookup which is why it looked like it was loopping so much + Revision 1.10 2004/07/27 08:42:29 reddawg chg: vfs_mount now ensures that malloc did not fail diff --git a/src/sys/vfs/vfs.c b/src/sys/vfs/vfs.c index 749cb8b..d90eefe 100644 --- a/src/sys/vfs/vfs.c +++ b/src/sys/vfs/vfs.c @@ -49,7 +49,7 @@ systemVitals->fileSystems = 0x0; /* Print information */ - kprintf("vfs0 - Address: [0x%X]\n",systemVitals->fileSystems); + kprintf("vfs0: loaded at address: [0x%X]\n",systemVitals->fileSystems); /* Return so we know things went well */ return(0x0); @@ -79,6 +79,7 @@ /* Allocate Memory */ tmpFs = (struct fileSystem *)kmalloc(sizeof(struct fileSystem)); if (tmpFs == 0x0) { + kprintf("vfsRegisterFS: memory allocation failed\n"); /* Memory Allocation Failed */ return(0x1); }