client = client_find_by_rpc_handle(handle);
if (!client) {
ErrPrint("Client %d is not exists\n", pid);
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
ret = packet_get(packet, "ss", &pkgname, &id);
if (ret != 2) {
ErrPrint("Parameter is not matched\n");
+ ret = LB_STATUS_ERROR_INVALID;
goto out;
}
script_info = instance_lb_script(inst);
if (!script_info) {
ErrPrint("Unable to get LB buffer: %s\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
fb_info = script_handler_fb(script_info);
if (!fb_info) {
ErrPrint("Unable to get fb_info: %s\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
buffer = fb_buffer_info(fb_info);
if (!buffer) {
ErrPrint("Unable to get buffer_info: %s\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
}
buf_ptr = buffer_handler_pixmap_ref(buffer);
if (!buf_ptr) {
ErrPrint("Failed to ref pixmap\n");
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
buffer_handler_pixmap_unref(buf_ptr);
} else {
pixmap = buffer_handler_pixmap(buffer);
+ ret = LB_STATUS_SUCCESS;
}
out:
- result = packet_create_reply(packet, "i", pixmap);
+ result = packet_create_reply(packet, "ii", pixmap, ret);
if (!result) {
ErrPrint("Failed to create a reply packet\n");
}
client = client_find_by_rpc_handle(handle);
if (!client) {
+ ret = LB_STATUS_ERROR_INVALID;
ErrPrint("Client %d is not exists\n", pid);
goto out;
}
ret = packet_get(packet, "ss", &pkgname, &id);
if (ret != 2) {
+ ret = LB_STATUS_ERROR_INVALID;
ErrPrint("Parameter is not matched\n");
goto out;
}
goto out;
}
+ if (instance_get_data(inst, "pd,resize,monitor")) {
+ ret = LB_STATUS_ERROR_BUSY;
+ goto out;
+ }
+
buffer = instance_pd_buffer(inst);
if (!buffer) {
struct script_info *script_info;
script_info = instance_pd_script(inst);
if (!script_info) {
ErrPrint("Unable to get LB buffer: %s\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
fb_info = script_handler_fb(script_info);
if (!fb_info) {
ErrPrint("Unable to get fb_info: %s\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
buffer = fb_buffer_info(fb_info);
if (!buffer) {
ErrPrint("Unable to get buffer_info: %s\n", id);
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
}
buf_ptr = buffer_handler_pixmap_ref(buffer);
if (!buf_ptr) {
ErrPrint("Failed to ref pixmap\n");
+ ret = LB_STATUS_ERROR_FAULT;
goto out;
}
pixmap = buffer_handler_pixmap(buffer);
out:
- result = packet_create_reply(packet, "i", pixmap);
+ result = packet_create_reply(packet, "ii", pixmap, ret);
if (!result) {
ErrPrint("Failed to create a reply packet\n");
}
is_resize = !!pd_monitor;
if (!is_resize) {
/* Invalid request. Reject this */
+ ErrPrint("Invalid request\n");
goto out;
}