Fix C generator 81/203781/1
authorHwankyu Jhun <h.jhun@samsung.com>
Thu, 18 Apr 2019 00:28:11 +0000 (09:28 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Thu, 18 Apr 2019 00:28:11 +0000 (09:28 +0900)
Returns a result of rpc_port_parcel_send()

Change-Id: Ic58f06d23df1f4167844885e5858f7dc9cfb0a6c
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
idlc/c_gen/c_stub_body_gen.cc
idlc/c_gen/c_stub_body_gen_cb.h

index b1448e1..19b5203 100644 (file)
@@ -173,7 +173,7 @@ std::string CStubBodyGen::GetMethodString(const Interface& inf,
       "    rpc_port_parcel_create(&result);\n" \
       "    rpc_port_parcel_write_int32(result, $$_METHOD_Result);\n" \
       "$$" \
-      "    rpc_port_parcel_send(result, port);\n" \
+      "    r = rpc_port_parcel_send(result, port);\n" \
       "    rpc_port_parcel_destroy(result);\n" \
       "} while (0);\n";
   const char ternary_operation[] = "## ? ## : \"\"";
index 0bacac4..d9ee148 100644 (file)
@@ -32,7 +32,7 @@ static int __$$_method_$$(rpc_port_h port, rpc_port_parcel_h parcel, void *data)
     }
 
 $$
-    return 0;
+    return r;
 }
 )__c_cb";
 
@@ -362,6 +362,7 @@ R"__c_cb(
 int rpc_port_$$_invoke($$)
 {
     rpc_port_parcel_h parcel = NULL;
+    int r;
 
     if (!h || !h->port) {
         _E("Invalid parameter");
@@ -382,11 +383,11 @@ int rpc_port_$$_invoke($$)
     rpc_port_parcel_write_int32(parcel, $$_METHOD_Callback);
     rpc_port_parcel_write(parcel, &h->parcelable, h);
 $$
-    rpc_port_parcel_send(parcel, h->port);
+    r = rpc_port_parcel_send(parcel, h->port);
     rpc_port_parcel_destroy(parcel);
     h->valid = false;
 
-    return 0;
+    return r;
 }
 )__c_cb";