if (ret != LB_STATUS_SUCCESS)
goto out;
- if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) {
- ret = LB_STATUS_ERROR_NO_SPACE;
- } else if (instance_pd_owner(inst)) {
+ if (instance_pd_owner(inst)) {
ret = LB_STATUS_ERROR_ALREADY;
} else if (package_pd_type(instance_package(inst)) == PD_TYPE_BUFFER) {
lazy_pd_destroyed_cb(inst);
goto out;
}
- if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) {
- ErrPrint("Not enough space\n");
- ret = LB_STATUS_ERROR_NO_SPACE;
- id = "";
- goto out;
- }
-
ret = validate_request(pkgname, id, &inst, &pkg);
id = "";
goto out;
}
- if (util_free_space(IMAGE_PATH) < MINIMUM_SPACE) {
- ErrPrint("Not enough space\n");
- ret = LB_STATUS_ERROR_NO_SPACE;
- id = "";
- goto out;
- }
-
ret = validate_request(pkgname, id, &inst, &pkg);
id = "";
if (ret != LB_STATUS_SUCCESS)
static struct packet *service_update(pid_t pid, int handle, const struct packet *packet)
{
+ Eina_List *inst_list;
struct pkg_info *pkg;
struct packet *result;
const char *pkgname;
goto out;
}
+ inst_list = package_instance_list(pkg);
+ if (!eina_list_count(inst_list)) {
+ ret = LB_STATUS_ERROR_NOT_EXIST;
+ DbgFree(lb_pkgname);
+ goto out;
+ }
+
+ if (id && strlen(id)) {
+ Eina_List *l;
+ struct inst_info *inst;
+
+ ret = LB_STATUS_ERROR_NOT_EXIST;
+ EINA_LIST_FOREACH(inst_list, l, inst) {
+ if (!strcmp(instance_id(inst), id)) {
+ ret = LB_STATUS_SUCCESS;
+ break;
+ }
+ }
+
+ if (ret == LB_STATUS_ERROR_NOT_EXIST) {
+ DbgFree(lb_pkgname);
+ goto out;
+ }
+ }
+
/*!
* \TODO
* Validate the update requstor.
*/
HAPI int service_common_unicast_packet(struct tcb *tcb, struct packet *packet)
{
- struct service_context *svc_ctx;
if (!tcb || !packet) {
DbgPrint("Invalid unicast: tcb[%p], packet[%p]\n", tcb, packet);
return -EINVAL;
}
- svc_ctx = tcb->svc_ctx;
-
DbgPrint("Unicast packet\n");
return secure_socket_send(tcb->fd, (void *)packet_data(packet), packet_size(packet));
}