diff options
author | Semun Lee <sm79.lee@samsung.com> | 2016-07-25 14:17:55 +0900 |
---|---|---|
committer | Semun Lee <sm79.lee@samsung.com> | 2016-07-25 14:19:22 +0900 |
commit | 2c573e60a5834ee4aa981f533c7cef05db3217ca (patch) | |
tree | d9e575cde641e1a51193f1ba1cb8e15411b336de | |
parent | 51b26353ea9015d647bc56b42a2c983e080ed220 (diff) | |
download | launchpad-2c573e60a5834ee4aa981f533c7cef05db3217ca.tar.gz launchpad-2c573e60a5834ee4aa981f533c7cef05db3217ca.tar.bz2 launchpad-2c573e60a5834ee4aa981f533c7cef05db3217ca.zip |
Make / slave only once for mounting legacy pathsubmit/tizen/20160725.053309accepted/tizen/wearable/20160725.064931accepted/tizen/tv/20160725.064935accepted/tizen/mobile/20160725.064937accepted/tizen/ivi/20160725.064942accepted/tizen/common/20160725.153610
Change-Id: I9f8cc6053095ba6218facb64596cbefa96f9c11f
Signed-off-by: Semun Lee <sm79.lee@samsung.com>
-rw-r--r-- | src/launchpad_common.c | 40 |
1 files changed, 11 insertions, 29 deletions
diff --git a/src/launchpad_common.c b/src/launchpad_common.c index f6e314f..0e9d63b 100644 --- a/src/launchpad_common.c +++ b/src/launchpad_common.c @@ -814,30 +814,6 @@ int _close_all_fds(const int except) return 0; } -static int __mount_and_make_private(const char *source, const char *target) -{ - int ret; - - ret = mount(NULL, "/", NULL, - MS_SLAVE | MS_REC, NULL); - if (ret != 0) { - _E("failed to set / as slave dir(%d)", ret); - return ret; - } - - ret = mount(source, target, - NULL, MS_BIND, NULL); - if (ret != 0) { - _E("failed to mount legacy dir(%d): %s to %s", - ret, source, target); - return ret; - } - - _D("end legacy path mount"); - - return ret; -} - int _mount_legacy_app_path(const char *app_root_path, const char *pkgid) { @@ -847,8 +823,6 @@ int _mount_legacy_app_path(const char *app_root_path, char user_app_data_path[PATH_MAX]; char legacy_app_data_path[PATH_MAX]; - _D("start legacy path mount"); - char *app_data_paths[5] = { "data", "cache", @@ -865,9 +839,17 @@ int _mount_legacy_app_path(const char *app_root_path, return -1; } + ret = mount(NULL, "/", NULL, + MS_SLAVE | MS_REC, NULL); + if (ret != 0) { + _E("failed to set / as slave dir(%d)", ret); + return ret; + } + /* for user private app */ if (!strncmp(app_root_path, user_app_dir, strlen(user_app_dir))) { - return __mount_and_make_private(app_root_path, legacy_app_path); + return mount(app_root_path, legacy_app_path, NULL, + MS_BIND, NULL); } /* for global app */ @@ -880,8 +862,8 @@ int _mount_legacy_app_path(const char *app_root_path, snprintf(legacy_app_data_path, PATH_MAX, "%s/%s", legacy_app_path, app_data_paths[i]); - ret = __mount_and_make_private(user_app_data_path, - legacy_app_data_path); + ret = mount(user_app_data_path, legacy_app_data_path, NULL, + MS_BIND, NULL); if (ret != 0) return ret; } |