summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHwankyu Jhun <h.jhun@samsung.com>2016-01-18 19:23:01 +0900
committerHwankyu Jhun <h.jhun@samsung.com>2016-01-18 19:26:14 +0900
commitc4120d52f711ed75e8034878842192c5920eee4b (patch)
tree728b1f3d063f3127267ba0e021a494f4bdc6b7fe
parent421dfc312dece5df34cd4a7f66563c333e72ada9 (diff)
downloadlaunchpad-c4120d52f711ed75e8034878842192c5920eee4b.tar.gz
launchpad-c4120d52f711ed75e8034878842192c5920eee4b.tar.bz2
launchpad-c4120d52f711ed75e8034878842192c5920eee4b.zip
Change-Id: I7f395b11adbe65849a12aa6ae0d7c16002808714 Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r--inc/launchpad_common.h1
-rw-r--r--src/launchpad_common.c7
2 files changed, 6 insertions, 2 deletions
diff --git a/inc/launchpad_common.h b/inc/launchpad_common.h
index 34aeb3a..3659583 100644
--- a/inc/launchpad_common.h
+++ b/inc/launchpad_common.h
@@ -67,6 +67,7 @@
typedef struct _app_pkt_t {
int cmd;
int len;
+ int opt;
unsigned char data[1];
} app_pkt_t;
diff --git a/src/launchpad_common.c b/src/launchpad_common.c
index f257716..c2a09c7 100644
--- a/src/launchpad_common.c
+++ b/src/launchpad_common.c
@@ -47,7 +47,7 @@
#define MAX_PENDING_CONNECTIONS 10
#define CONNECT_RETRY_TIME 100 * 1000
#define CONNECT_RETRY_COUNT 3
-#define AUL_PKT_HEADER_SIZE (sizeof(int) + sizeof(int))
+#define AUL_PKT_HEADER_SIZE (sizeof(int) + sizeof(int) + sizeof(int))
static int __read_proc(const char *path, char *buf, int size)
{
@@ -233,6 +233,7 @@ app_pkt_t *_recv_pkt_raw(int fd, int *clifd, struct ucred *cr)
unsigned char buf[AUL_SOCK_MAXBUFF];
int cmd;
int datalen;
+ int opt;
sun_size = sizeof(struct sockaddr_un);
@@ -266,6 +267,7 @@ retry_recv:
}
memcpy(&cmd, buf, sizeof(int));
memcpy(&datalen, buf + sizeof(int), sizeof(int));
+ memcpy(&opt, buf + sizeof(int) + sizeof(int), sizeof(int));
/* allocate for a null byte */
pkt = (app_pkt_t *)calloc(1, AUL_PKT_HEADER_SIZE + datalen + 1);
@@ -275,6 +277,7 @@ retry_recv:
}
pkt->cmd = cmd;
pkt->len = datalen;
+ pkt->opt = opt;
len = 0;
while (len != pkt->len) {
@@ -302,7 +305,7 @@ int _send_pkt_raw(int client_fd, app_pkt_t *pkt)
goto error;
}
- pkt_size = sizeof(pkt->cmd) + sizeof(pkt->len) + pkt->len;
+ pkt_size = AUL_PKT_HEADER_SIZE + pkt->len;
send_ret = send(client_fd, pkt, pkt_size, 0);
_D("send(%d) : %d / %d", client_fd, send_ret, pkt_size);