Add option on app_pkt_t type 46/57246/1 submit/tizen/20160119.012430
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 18 Jan 2016 10:30:32 +0000 (19:30 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 18 Jan 2016 10:33:13 +0000 (19:33 +0900)
- remove unused function

Change-Id: If7326aa3cac98016b451202b5aee2a5a4c60e8ff
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
include/common.h
src/common.c

index de44eab65f17481fc1627bd623125d5a4a14bf03..cff6fa67b759c2b66dc4121a73bd0191f9efee8e 100644 (file)
@@ -43,6 +43,7 @@
 typedef struct _app_pkt_t {
        int cmd;
        int len;
+       int opt;
        unsigned char data[1];
 } app_pkt_t;
 
@@ -61,7 +62,6 @@ struct ucred;
 
 int _create_server_sock(void);
 app_pkt_t *_recv_pkt_raw(int fd, int *clifd, struct ucred *cr);
-int _send_pkt_raw(int client_fd, app_pkt_t *pkt);
 
 appinfo_t *_appinfo_create(bundle *kb);
 void _appinfo_free(appinfo_t *appinfo);
index a84ac6aaeda1cc2f0d380ed6987e09cfd4b42261..5cb31e18636487f9560bfa7149c9f0c24526efec 100644 (file)
@@ -51,7 +51,7 @@
 #define MAX_CMD_BUFSZ 1024
 #define PATH_TMP "/tmp"
 #define PATH_DATA "/data"
-#define AUL_PKT_HEADER_SIZE (sizeof(int) + sizeof(int))
+#define AUL_PKT_HEADER_SIZE (sizeof(int) + sizeof(int) + sizeof(int))
 
 static void __set_sock_option(int fd, int cli)
 {
@@ -162,6 +162,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);
 
@@ -195,6 +196,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);
@@ -204,6 +206,7 @@ retry_recv:
        }
        pkt->cmd = cmd;
        pkt->len = datalen;
+       pkt->opt = opt;
 
        len = 0;
        while (len != pkt->len) {
@@ -221,32 +224,6 @@ retry_recv:
        return pkt;
 }
 
-int _send_pkt_raw(int client_fd, app_pkt_t *pkt)
-{
-       int send_ret = 0;
-       int pkt_size = 0;
-
-       if (client_fd == -1 || pkt == NULL) {
-               _E("arguments error!");
-               return -1;
-       }
-
-       pkt_size = sizeof(pkt->cmd) + sizeof(pkt->len) + pkt->len;
-
-       send_ret = send(client_fd, pkt, pkt_size, 0);
-       _D("send(%d) : %d / %d", client_fd, send_ret, pkt_size);
-
-       if (send_ret == -1) {
-               _E("send error!");
-               return -1;
-       } else if (send_ret != pkt_size) {
-               _E("send byte fail!");
-               return -1;
-       }
-
-       return 0;
-}
-
 static char *__appinfo_get_app_path(appinfo_t *appinfo)
 {
        int i = 0;