Propagate failure of sending updated event via socket
authorSung-jae Park <nicesj.park@samsung.com>
Wed, 12 Nov 2014 14:30:35 +0000 (23:30 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Wed, 12 Nov 2014 14:30:35 +0000 (23:30 +0900)
[model] Redwood,Kiran,B3(Wearable)
[binary_type] AP
[customer] Docomo/Orange/ATT/Open
[issue#] N/A
[problem]
[cause]
[solution]
[team] HomeTF
[request]
[horizontal_expansion]

Change-Id: I370858203c586d5828a00f144395538c5abd1b0d

src/dynamicbox.c

index 9f3040c..614d20f 100644 (file)
@@ -832,6 +832,7 @@ PUBLIC int dynamicbox_sync_buffer(dynamicbox_buffer_h handle)
     int w;
     int h;
     int pixel_size;
+    int ret;
 
     if (!handle) {
        return DBOX_STATUS_ERROR_INVALID_PARAMETER;
@@ -871,18 +872,12 @@ PUBLIC int dynamicbox_sync_buffer(dynamicbox_buffer_h handle)
      * manipulate the damaged region, so send update event only for the damaged region.
      * to make more efficient updates
      */
-
-    if (user_data->is_gbar == 1) {
-       if (send_updated(pkgname, id, handle, DBOX_PRIMARY_BUFFER, 0, 0, w, h, user_data->is_gbar, NULL) < 0) {
-           ErrPrint("Failed to send GBAR updated (%s)\n", id);
-       }
-    } else {
-       if (send_updated(pkgname, id, handle, DBOX_PRIMARY_BUFFER, 0, 0, w, h, user_data->is_gbar, NULL) < 0) {
-           ErrPrint("Failed to send updated (%s)\n", id);
-       }
+    ret = send_updated(pkgname, id, handle, DBOX_PRIMARY_BUFFER, 0, 0, w, h, user_data->is_gbar, NULL);
+    if (ret < 0) {
+       ErrPrint("Failed to send%supdated (%s)\n", user_data->is_gbar ? " GBAR " : " ", id);
     }
 
-    return DBOX_STATUS_ERROR_NONE;
+    return ret;
 }
 
 PUBLIC int dynamicbox_send_updated_by_idx(dynamicbox_buffer_h handle, int idx)
@@ -919,7 +914,7 @@ PUBLIC int dynamicbox_send_updated_by_idx(dynamicbox_buffer_h handle, int idx)
 
     ret = send_updated(pkgname, id, handle, idx, 0, 0, w, h, user_data->is_gbar, NULL);
     if (ret < 0) {
-       ErrPrint("Failed to send GBAR updated (%s) %d\n", id, idx);
+       ErrPrint("Failed to send%supdated (%s) %d\n", user_data->is_gbar ? " GBAR " : " ", id, idx);
     }
 
     return ret;
@@ -1076,12 +1071,13 @@ PUBLIC int dynamicbox_buffer_post_render(dynamicbox_buffer_h handle)
      * to make more efficient updates
      */
 
-    if (send_updated(pkgname, id, handle, DBOX_PRIMARY_BUFFER, 0, 0, w, h, user_data->is_gbar, NULL) < 0) {
-       ErrPrint("Failed to send GBAR updated (%s)\n", id);
+    ret = send_updated(pkgname, id, handle, DBOX_PRIMARY_BUFFER, 0, 0, w, h, user_data->is_gbar, NULL);
+    if (ret < 0) {
+       ErrPrint("Failed to send%supdated (%s)\n", user_data->is_gbar ? " GBAR " : " ", id);
     }
 
     PERF_MARK("post_render");
-    return DBOX_STATUS_ERROR_NONE;
+    return ret;
 }
 
 PUBLIC int dynamicbox_buffer_stride(dynamicbox_buffer_h handle)