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 {
{
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));
}
}
struct inst_info *inst;
const struct pkg_info *pkg;
int ret;
+ int type;
client = client_find_by_rpc_handle(handle);
if (!client) {
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:
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: