Sync with the latest code of phone profile
[platform/framework/web/data-provider-master.git] / src / event.c
index 0802ea0..0604c11 100644 (file)
@@ -71,6 +71,7 @@ static struct info {
                .y = -1,
                .device = -1,
                .slot = -1,
+               .keycode = 0,
        },
 
        .event_listener_list = NULL,
@@ -178,6 +179,8 @@ static inline int processing_input_event(struct input_event *event)
                }
                break;
        case EV_KEY:
+               DbgPrint("EV_KEY: 0x%X\n", event->value);
+               s_info.event_data.keycode = event->value;
                break;
        case EV_REL:
                break;
@@ -245,7 +248,7 @@ static inline int processing_input_event(struct input_event *event)
 static void *event_thread_main(void *data)
 {
        fd_set set;
-       int ret = 0;
+       long ret = 0;
        struct input_event input_event;
        char *ptr = (char *)&input_event;
        int offset = 0;
@@ -492,7 +495,7 @@ static int activate_thread(void)
                ErrPrint("Error: %s\n", strerror(errno));
        }
 
-       status = pipe2(s_info.evt_pipe, O_NONBLOCK | O_CLOEXEC);
+       status = pipe2(s_info.evt_pipe, O_CLOEXEC);
        if (status < 0) {
                ErrPrint("Unable to prepare evt pipe: %s\n", strerror(errno));
                if (close(s_info.handle) < 0) {
@@ -502,7 +505,7 @@ static int activate_thread(void)
                return LB_STATUS_ERROR_FAULT;
        }
 
-       status = pipe2(s_info.tcb_pipe, O_NONBLOCK | O_CLOEXEC);
+       status = pipe2(s_info.tcb_pipe, O_CLOEXEC);
        if (status < 0) {
                ErrPrint("Unable to prepare tcb pipe: %s\n", strerror(errno));
                if (close(s_info.handle) < 0) {
@@ -642,7 +645,7 @@ HAPI int event_deactivate(int (*event_cb)(enum event_state state, struct event_d
        if (status != 0) {
                ErrPrint("Failed to join a thread: %s\n", strerror(errno));
        } else {
-               DbgPrint("Thread returns: %d\n", (int)ret);
+               DbgPrint("Thread returns: %p\n", ret);
        }
 
        if (close(s_info.handle) < 0) {