diff options
-rw-r--r-- | fs/fs.c | 5 | ||||
-rw-r--r-- | include/fs.h | 1 |
2 files changed, 6 insertions, 0 deletions
@@ -251,6 +251,8 @@ static FILE *get_file(void) static void put_file(FILE *f) { + free(f->path); + f->path = NULL; f->in_use = 0; } @@ -670,6 +672,9 @@ int open(const char *pathname, int flags, ...) if (ret) goto out; } + + f->path = xstrdup(path); + ret = fsdrv->open(&fsdev->dev, f, path); if (ret) goto out; diff --git a/include/fs.h b/include/fs.h index c3ce81ae98..6eddb2312f 100644 --- a/include/fs.h +++ b/include/fs.h @@ -24,6 +24,7 @@ typedef struct dir { typedef struct filep { struct fs_device_d *fsdev; /* The device this FILE belongs to */ + char *path; loff_t pos; /* current position in stream */ #define FILE_SIZE_STREAM ((loff_t) -1) loff_t size; /* The size of this inode */ |