Add new event path for propagating the delete type.
authorSung-jae Park <nicesj.park@samsung.com>
Fri, 13 Dec 2013 08:48:02 +0000 (17:48 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Fri, 13 Dec 2013 08:48:02 +0000 (17:48 +0900)
Change-Id: Ic36bfcbd5135167c628ef7b1df96fccd5cbcaa18

include/instance.h
packaging/data-provider-master.spec
src/main.c
src/server.c

index cf04b3f..b9b8674 100644 (file)
@@ -100,7 +100,8 @@ enum instance_destroy_type {
        INSTANCE_DESTROY_UNINSTALL = 0x02,
        INSTANCE_DESTROY_TERMINATE = 0x03,
        INSTANCE_DESTROY_FAULT = 0x04,
-       INSTANCE_DESTROY_UNKNOWN = 0x05,
+       INSTANCE_DESTROY_TEMPORARY = 0x05,
+       INSTANCE_DESTROY_UNKNOWN = 0x06
 };
 
 enum instance_state {
index 73aeeca..4015984 100755 (executable)
@@ -1,6 +1,6 @@
 Name: data-provider-master
 Summary: Master service provider for liveboxes
-Version: 0.28.2
+Version: 0.29.0
 Release: 1
 Group: HomeTF/Livebox
 License: Flora
index 7c1b7f6..9e40ac0 100755 (executable)
@@ -69,8 +69,8 @@ static inline int app_create(void)
 {
        int ret;
 
-       if (access(SLAVE_LOG_PATH, R_OK|W_OK) != 0) {
-               if (mkdir(SLAVE_LOG_PATH, 755) < 0) {
+       if (access(SLAVE_LOG_PATH, R_OK | W_OK) != 0) {
+               if (mkdir(SLAVE_LOG_PATH, 0755) < 0) {
                        ErrPrint("Failed to create %s (%s)\n", SLAVE_LOG_PATH, strerror(errno));
                }
        }
index 295fd88..9c92be3 100644 (file)
@@ -974,6 +974,7 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
        struct inst_info *inst;
        const struct pkg_info *pkg;
        int ret;
+       int type;
 
        client = client_find_by_rpc_handle(handle);
        if (!client) {
@@ -982,12 +983,20 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
                goto out;
        }
 
-       ret = packet_get(packet, "ss", &pkgname, &id);
-       if (ret != 2) {
+       ret = packet_get(packet, "ssi", &pkgname, &id, &type);
+       if (ret != 3) {
                ErrPrint("Parameter is not matched\n");
                ret = LB_STATUS_ERROR_INVALID;
                goto out;
        }
+       /*!
+        * \note
+        * Below two types must has to be sync'd with livebox-viewer
+        *
+        * LB_DELETE_PERMANENTLY = 0x01,
+        * LB_DELETE_TEMPORARY = 0x02,
+        *
+        */
 
        /*!
         * \NOTE:
@@ -1041,7 +1050,16 @@ static struct packet *client_delete(pid_t pid, int handle, const struct packet *
                        ret = LB_STATUS_ERROR_PERMISSION;
                }
        } else {
-               ret = instance_destroy(inst, INSTANCE_DESTROY_DEFAULT);
+               switch (type) {
+               case LB_DELETE_PERMANENTLY:
+                       ret = instance_destroy(inst, INSTANCE_DESTROY_DEFAULT);
+                       break;
+               case LB_DELETE_TEMPORARY:
+                       ret = instance_destroy(inst, INSTANCE_DESTROY_TEMPORARY);
+                       break;
+               default:
+                       break;
+               }
        }
 
 out: