summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-11-27 11:21:59 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-11-27 11:22:01 +0100
commit812c6f2beace08c1af3c851c30d87e8c55d357ff (patch)
treec52af52064bdd07d247fae91ef514f897f89d153 /fs
parent239699fc831434c8697dda088dc9c971a3f5542d (diff)
downloadbarebox-812c6f2beace08c1af3c851c30d87e8c55d357ff.tar.gz
barebox-812c6f2beace08c1af3c851c30d87e8c55d357ff.tar.xz
Fix endless loop in automount code
A chdir to a path registered as an automount path followed by a 'ls' results in an endless loop. This happens because the command the automounter executes results in another automount request. Fix this by running the automounter from the chdir code before the cwd is actually changed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r--fs/fs.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index 4563a8126a..32dba8cf0a 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -579,6 +579,8 @@ int chdir(const char *pathname)
if (ret)
goto out;
+ automount_mount(p, 0);
+
strcpy(cwd, p);
out: