diff options
author | Nan Liu <nan.liu619@gmail.com> | 2015-07-21 19:44:07 +0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2015-07-22 10:36:49 -0700 |
commit | 12df1e118a78035f0319cd15f77eb29db5fa1dd9 (patch) | |
tree | f79c49e4f1df5197bc09de212451d96133891583 /init/builtins.cpp | |
parent | 3f1d7ebbc81fad6eea14811bbf31acb41ca38499 (diff) |
init: use init's property expansion code for mount_all
Change-Id: I3bd00c74cd126b66927eca7812943f8427009356
Signed-off-by: Nan Liu <nan.liu619@gmail.com>
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r-- | init/builtins.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/init/builtins.cpp b/init/builtins.cpp index d5d3faff6..8d47da445 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -468,11 +468,17 @@ int do_mount_all(int nargs, char **args) int child_ret = -1; int status; struct fstab *fstab; + char fstabfile[PROP_VALUE_MAX]; if (nargs != 2) { return -1; } + if (expand_props(fstabfile, args[1], sizeof(fstabfile)) == -1) { + ERROR("mount_all: cannot expand '%s' \n", args[1]); + return -EINVAL; + } + /* * Call fs_mgr_mount_all() to mount all filesystems. We fork(2) and * do the call in the child to provide protection to the main init @@ -496,7 +502,7 @@ int do_mount_all(int nargs, char **args) } else if (pid == 0) { /* child, call fs_mgr_mount_all() */ klog_set_level(6); /* So we can see what fs_mgr_mount_all() does */ - fstab = fs_mgr_read_fstab(args[1]); + fstab = fs_mgr_read_fstab(fstabfile); child_ret = fs_mgr_mount_all(fstab); fs_mgr_free_fstab(fstab); if (child_ret == -1) { |