diff --git a/src/sys/kernel/file.c b/src/sys/kernel/file.c index b6b680f..46901a2 100644 --- a/src/sys/kernel/file.c +++ b/src/sys/kernel/file.c @@ -59,43 +59,6 @@ /************************************************************************ -Function: int fclose(fileDescriptor *fd); -Description: This Will Close And Free A File Descriptor -Notes: - -************************************************************************/ -int fclose(fileDescriptor *fd) { - fileDescriptor *tmpFd = 0x0; - /* Search For File Descriptor */ - for (tmpFd=fdTable;tmpFd;tmpFd=tmpFd->next) { - if (tmpFd == fd) { - /* If Fd Is The First FD Then Reset fdTable */ - if (tmpFd == fdTable) { - fdTable = tmpFd->next; - if (fdTable != 0x0) { - fdTable->prev = 0x0; - } - kfree(fd->buffer); - kfree(fd); - systemVitals->openFiles--; - return(1); - } - else { - tmpFd->prev->next = tmpFd->next; - tmpFd->next->prev = tmpFd->prev; - kfree(fd->buffer); - kfree(fd); - systemVitals->openFiles--; - return(1); - } - } - } - /* Return NULL If Descriptor Was Not Found */ - return(0x0); - } - -/************************************************************************ - Function: int fputc(int ch,fileDescriptor *fd) Description: This Will Write Character To FD Notes: @@ -293,6 +256,9 @@ /*** $Log$ + Revision 1.3 2004/06/16 16:31:58 reddawg + ld.so: the dynamic linker works and has been tested + Revision 1.2 2004/05/15 02:30:28 reddawg Lots of changes diff --git a/src/sys/vfs/file.c b/src/sys/vfs/file.c index 97e4131..b274826 100644 --- a/src/sys/vfs/file.c +++ b/src/sys/vfs/file.c @@ -23,21 +23,6 @@ TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - $Log$ - Revision 1.3 2004/06/01 00:04:53 reddawg - Try now mark - - Revision 1.2 2004/05/19 04:07:43 reddawg - kmalloc(size,pid) no more it is no kmalloc(size); the way it should of been - - Revision 1.1.1.1 2004/04/15 12:06:53 reddawg - UbixOS v1.0 - - Revision 1.12 2004/04/13 16:36:34 reddawg - Changed our copyright, it is all now under a BSD-Style license - - - $Id$ *****************************************************************************************/ @@ -52,7 +37,42 @@ #include #include +/************************************************************************ +Function: int fclose(fileDescriptor *fd); +Description: This Will Close And Free A File Descriptor +Notes: + +************************************************************************/ +int fclose(fileDescriptor *fd) { + fileDescriptor *tmpFd = 0x0; + /* Search For File Descriptor */ + for (tmpFd=fdTable;tmpFd;tmpFd=tmpFd->next) { + if (tmpFd == fd) { + /* If Fd Is The First FD Then Reset fdTable */ + if (tmpFd == fdTable) { + fdTable = tmpFd->next; + if (fdTable != 0x0) { + fdTable->prev = 0x0; + } + kfree(fd->buffer); + kfree(fd); + systemVitals->openFiles--; + return(1); + } + else { + tmpFd->prev->next = tmpFd->next; + tmpFd->next->prev = tmpFd->prev; + kfree(fd->buffer); + kfree(fd); + systemVitals->openFiles--; + return(1); + } + } + } + /* Return NULL If Descriptor Was Not Found */ + return(0x0); + } /************************************************************************ @@ -229,6 +249,22 @@ } /*** + $Log$ + Revision 1.4 2004/06/14 12:20:54 reddawg + notes: many bugs repaired and ld works 100% now. + + Revision 1.3 2004/06/01 00:04:53 reddawg + Try now mark + + Revision 1.2 2004/05/19 04:07:43 reddawg + kmalloc(size,pid) no more it is no kmalloc(size); the way it should of been + + Revision 1.1.1.1 2004/04/15 12:06:53 reddawg + UbixOS v1.0 + + Revision 1.12 2004/04/13 16:36:34 reddawg + Changed our copyright, it is all now under a BSD-Style license + END ***/