<div dir="ltr">This patch adds a reply to the file write ubus call:<div><div><div>{</div><div><span class="" style="white-space:pre"> </span>"code": 0,</div><div><span class="" style="white-space:pre"> </span>"bytes": 9</div><div>}</div><div><br></div><div>Where code is the return code of the operation and bytes is the number of bytes written. </div></div><div><br></div><div>Getting a response is helpful since it lets the user know if the write operation was successful, knowing the number of bytes written allows for further error checking.</div><div>
<p class="">Can this patch be merged into the rpcd repo?</p><p class=""><br></p></div><div><br></div><div><div>Index: rpcd/file.c</div><div>===================================================================</div><div>--- rpcd.orig/file.c<span class="" style="white-space:pre"> </span>2016-05-17 22:07:03.679363210 +0000</div><div>+++ rpcd/file.c<span class="" style="white-space:pre"> </span>2016-05-17 22:08:15.627440178 +0000</div><div>@@ -315,6 +315,12 @@</div><div> <span class="" style="white-space:pre"> </span>close(fd);</div><div> <span class="" style="white-space:pre"> </span>sync();</div><div> </div><div>+<span class="" style="white-space:pre"> </span>blob_buf_init(&buf, 0);</div><div>+<span class="" style="white-space:pre"> </span>blobmsg_add_u32<span class="" style="white-space:pre"> </span>(&buf, "code", rv);</div><div>+<span class="" style="white-space:pre"> </span>blobmsg_add_u32<span class="" style="white-space:pre"> </span>(&buf, "bytes", (int)data_len);</div><div>+<span class="" style="white-space:pre"> </span>ubus_send_reply<span class="" style="white-space:pre"> </span>(ctx, req, buf.head);</div><div>+<span class="" style="white-space:pre"> </span>blob_buf_free(&buf);</div><div>+</div><div> <span class="" style="white-space:pre"> </span>if (rv)</div><div> <span class="" style="white-space:pre"> </span>return rpc_errno_status();</div><div> </div></div><div><br></div></div></div>