diff --git a/src/sys/include/vfs/vfs.h b/src/sys/include/vfs/vfs.h index 955a902..082fc33 100644 --- a/src/sys/include/vfs/vfs.h +++ b/src/sys/include/vfs/vfs.h @@ -72,7 +72,7 @@ int (*vfsRead)(void *,char *,long,long); /*!< pointer to read routine */ int (*vfsWrite)(void *,char *,long,long); /*!< pointer to write routine */ int (*vfsOpenFile)(void *,void *); /*!< pointer to openfile routine */ - int (*vfsCloseFile)(void *,void *); /*!< pointer to closefile routine */ + int (*vfsCloseFile)(void *); /*!< pointer to closefile routine */ int (*vfsUnlink)(char *,void *); /*!< pointer to unlink routine */ int (*vfsMakeDir)(char *,void *); /*!< pointer to makedir routine */ int (*vfsRemDir)(char *); /*!< pointer to remdir routine */ diff --git a/src/sys/vfs/vfs_syscalls.c b/src/sys/vfs/vfs_syscalls.c index 1f7a6b5..cb906fd 100644 --- a/src/sys/vfs/vfs_syscalls.c +++ b/src/sys/vfs/vfs_syscalls.c @@ -227,12 +227,12 @@ getfd(td,&fd,uap->fd); + //! Call the fs close function first + fd->mp->fs->vfsCloseFile(fd); + if (fd->buffer != 0x0) kfree(fd->buffer); - if (fd->fsObj != 0x0) - kfree(fd->fsObj); - kfree((void *)td->o_files[uap->fd]); td->o_files[uap->fd] = 0x0; td->td_retval[0] = 0x0;