Fix code warning.
Change-Id: Ib11fb49f528d3688351ae349d5b4e307c28b3967
diff --git a/mbtk/libmbtk_lib/sleep/mbtk_lpm.c b/mbtk/libmbtk_lib/sleep/mbtk_lpm.c
index b18a660..19681a0 100755
--- a/mbtk/libmbtk_lib/sleep/mbtk_lpm.c
+++ b/mbtk/libmbtk_lib/sleep/mbtk_lpm.c
@@ -25,6 +25,7 @@
#include "mbtk_lpm.h"
#include "mbtk_type.h"
#include "mbtk_log.h"
+#include "mbtk_utils.h"
static mbtk_lpm_handler_t lpm_init;
@@ -56,7 +57,7 @@
do {
ret = epoll_ctl( epoll_fd, EPOLL_CTL_ADD, fd, &ev );
} while (ret < 0 && errno == EINTR);
-
+
return ret;
}
@@ -80,8 +81,6 @@
while (true)
{
struct epoll_event events[2];
- struct epoll_event ev;
- int cmd = 0;
int numEvents = epoll_wait(epoll_fd_t, events, 2, -1);
@@ -98,7 +97,7 @@
if (events[i].data.fd == socket_t[1])
{
memset(buf, 0, sizeof(buf));
- read(socket_t[1], buf, sizeof(buf));
+ mbtk_read(socket_t[1], buf, sizeof(buf));
if (1 == atoi(buf))
{
if(close(fd_t) == 0)
@@ -115,7 +114,7 @@
{
LOGI("go pthread_event");
memset(&ev_input, 0x00, size);
- read(fd_t, &ev_input, size);
+ mbtk_read(fd_t, &ev_input, size);
LOGI("ev_input type = %x, code = %x, value = %x", ev_input.type, ev_input.code,ev_input.value);
if (ev_input.type == 4 && ev_input.code == 3)
@@ -137,7 +136,7 @@
int mbtk_lpm_init(mbtk_lpm_handler_t mbtk_lpm_handler)
{
- if (socketpair( AF_LOCAL, SOCK_STREAM, 0, socket_t ) < 0 )
+ if (socketpair( AF_LOCAL, SOCK_STREAM, 0, socket_t ) < 0 )
{
LOGE("[mbtk_lpm_init] could not create thread control socket pair: %s", strerror(errno));
@@ -147,7 +146,7 @@
close(socket_t[0] );
socket_t[0] = -1;
}
-
+
if(socket_t[1] > 0)
{
close(socket_t[1] );
@@ -189,8 +188,8 @@
{
//char cmd = 1;
strcpy(buf, "1");
- void* dummy = NULL;
- write( socket_t[0], buf, sizeof(buf) );
+// void* dummy = NULL;
+ mbtk_write( socket_t[0], buf, sizeof(buf) );
sleep(1);
// close the control socket pair