diff options
author | H. Peter Anvin <hpa@zytor.com> | 2012-06-28 21:34:28 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2012-06-28 21:34:28 -0700 |
commit | 53f267c1e4c6c51819a355e163b4b6c3214a852e (patch) | |
tree | 376ef236f9de744df4f56e8d13e82f869973a10f /core/fs/fs.c | |
parent | 9794e01d73e5cc2621f85d91b0577e33df9920fb (diff) | |
parent | 15cbfdfd390402057d237664ac087140608bf80b (diff) | |
download | syslinux-53f267c1e4c6c51819a355e163b4b6c3214a852e.tar.gz |
Merge remote-tracking branch 'origin/master' into elflink
Conflicts:
core/fs/lib/searchconfig.c
Get the reverse pathname lookup fixes from the master branch.
Diffstat (limited to 'core/fs/fs.c')
-rw-r--r-- | core/fs/fs.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/fs/fs.c b/core/fs/fs.c index f6b29125..7b0f6cea 100644 --- a/core/fs/fs.c +++ b/core/fs/fs.c @@ -43,6 +43,8 @@ void put_inode(struct inode *inode) while (inode && --inode->refcnt == 0) { struct inode *dead = inode; inode = inode->parent; + if (dead->name) + free((char *)dead->name); free(dead); } } @@ -224,6 +226,9 @@ int searchdir(const char *name) char *part, *p, echar; int symlink_count = MAX_SYMLINK_CNT; + dprintf("searchdir: %s root: %p cwd: %p\n", + name, this_fs->root, this_fs->cwd); + if (!(file = alloc_file())) goto err_no_close; file->fs = this_fs; @@ -322,6 +327,9 @@ int searchdir(const char *name) goto got_link; } + inode->name = strdup(part); + dprintf("path component: %s\n", inode->name); + inode->parent = parent; parent = NULL; @@ -366,6 +374,8 @@ int open_file(const char *name, struct com32_filedata *filedata) struct file *file; char mangled_name[FILENAME_MAX]; + dprintf("open_file %s\n", name); + mangle_name(mangled_name, name); rv = searchdir(mangled_name); @@ -393,6 +403,8 @@ void pm_open_file(com32sys_t *regs) const char *name = MK_PTR(regs->es, regs->esi.w[0]); char mangled_name[FILENAME_MAX]; + dprintf("pm_open_file %s\n", name); + mangle_name(mangled_name, name); rv = searchdir(mangled_name); if (rv < 0) { @@ -487,6 +499,7 @@ void fs_init(com32sys_t *regs) if (fs.fs_ops->iget_root) { fs.root = fs.fs_ops->iget_root(&fs); fs.cwd = get_inode(fs.root); + dprintf("init: root inode %p, cwd inode %p\n", fs.root, fs.cwd); } if (fs.fs_ops->chdir_start) { |