return 0;
}
-static void __send_result_to_caller(int clifd, int ret, const char *app_path)
+static void __send_result_to_caller(int clifd, int ret)
{
_W("send result: %d", ret);
menu_info = _appinfo_create(kb);
if (menu_info == NULL) {
_E("such pkg no found");
+ __send_result_to_caller(clifd, -EINVAL);
+ clifd = -1;
goto end;
}
app_path = _appinfo_get_app_path(menu_info);
if (app_path == NULL) {
_E("app_path is NULL");
+ __send_result_to_caller(clifd, -EINVAL);
+ clifd = -1;
goto end;
}
+
if (app_path[0] != '/') {
_E("app_path is not absolute path");
+ __send_result_to_caller(clifd, -EINVAL);
+ clifd = -1;
+ goto end;
+ }
+
+ if (access(app_path, X_OK) != 0) {
+ ret = -errno;
+ _E("%s is not executable. errno(%d)", app_path, errno);
+ __send_result_to_caller(clifd, ret);
+ clifd = -1;
goto end;
}
if (menu_info->hwacc == NULL) {
_E("[launchpad] Failed to find H/W acceleration type");
+ __send_result_to_caller(clifd, -EINVAL);
+ clifd = -1;
goto end;
}
_modify_bundle(kb, cr.pid, menu_info, pkt->cmd);
if (menu_info->appid == NULL) {
_E("unable to get appid from menu_info");
+ __send_result_to_caller(clifd, -EINVAL);
+ clifd = -1;
goto end;
}
}
_memory_monitor_reset_timer();
- __send_result_to_caller(clifd, pid, app_path);
+ __send_result_to_caller(clifd, pid);
clifd = -1;
end:
if (clifd != -1)