This patch adds a condition for pending (such as RPC_PORT_STUB_PREPARE) in case of a request that requires some pending.
Change-Id: I771c9f0d77763cd05f1527485c6612400e09b0f1
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
}
}
+static bool __check_to_need_pending(request_h req)
+{
+ switch (req->cmd) {
+ case RPC_PORT_PREPARE_STUB:
+ return true;
+ default:
+ return false;
+ }
+}
+
static int __check_request(request_h req)
{
int pid;
pid = _app_status_get_pid(app_status);
item = g_hash_table_lookup(pending_table, GINT_TO_POINTER(pid));
- if (item == NULL)
- return 0;
+ if (item == NULL) {
+ if (!__check_to_need_pending(req))
+ return 0;
+
+ item = calloc(1, sizeof(struct pending_item));
+ if (item == NULL) {
+ _E("Out of memory");
+ return -1;
+ }
+ item->pid = pid;
+ g_hash_table_insert(pending_table, GINT_TO_POINTER(pid), item);
+ }
if (!_app_status_is_starting(app_status)) {
req->t_pid = pid;