_app_status_update_status(app_status, status, false, true);
}
-static void __check_socket_status(int pid, uid_t uid, const char *appid)
-{
- app_status_h app_status;
- char path[PATH_MAX];
- char buf[12] = { 0, };
- FILE *fp;
-
- app_status = _app_status_find(pid);
- if (!app_status)
- return;
-
- snprintf(path, sizeof(path), "/run/aul/apps/%u/%d/%s", pid, uid, appid);
- fp = fopen(path, "r");
- if (!fp) {
- _E("fopen() is failed. path(%s), errno(%d)", path, errno);
- return;
- }
-
- if (fgets(buf, sizeof(buf), fp) == NULL) {
- _E("fgets() is failed. path(%s)", path);
- fclose(fp);
- return;
- }
- fclose(fp);
-
- if (!strcmp(buf, "1")) {
- _W("%s(%d) socket is listening", appid, pid);
- app_status->socket_exists = true;
- }
-}
-
int _app_status_register_pid(int pid, const char *appid, uid_t uid)
{
struct appinfo *ai;
component_type = _appinfo_get_value(ai, AIT_COMPTYPE);
_app_status_add_app_info(ai, pid, false, uid, getpid(),
false, NULL, false);
- __check_socket_status(pid, uid, appid);
_noti_send(AMD_NOTI_MSG_APP_STATUS_APP_REGISTER_PID, pid, 0, ai, NULL);
if (component_type && strcmp(component_type, APP_TYPE_SERVICE) != 0) {
ret = _signal_get_proc_status_async(pid,