summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/fs.c5
-rw-r--r--include/fs.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 04b6408802..436f5cb751 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -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 */