[ovs-dev,13/15] jsonrpc: Add comment for jsonrpc_msg_to_json().

Message ID 20180101051640.13043-13-blp@ovn.org
State Accepted
Delegated to: Justin Pettit
Headers show
Series
  • [ovs-dev,01/15] log: Add async commit support.
Related show

Commit Message

Ben Pfaff Jan. 1, 2018, 5:16 a.m.
From a glance at the prototype it wasn't obvious that it destroyed its
argument.

Signed-off-by: Ben Pfaff <blp@ovn.org>
---
 lib/jsonrpc.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Justin Pettit Feb. 5, 2018, 10:38 p.m. | #1
> On Dec 31, 2017, at 9:16 PM, Ben Pfaff <blp@ovn.org> wrote:
> 
> From a glance at the prototype it wasn't obvious that it destroyed its
> argument.
> 
> Signed-off-by: Ben Pfaff <blp@ovn.org>

Acked-by: Justin Pettit <jpettit@ovn.org>

--Justin
Ben Pfaff Feb. 6, 2018, 7:15 p.m. | #2
On Mon, Feb 05, 2018 at 02:38:28PM -0800, Justin Pettit wrote:
> 
> 
> > On Dec 31, 2017, at 9:16 PM, Ben Pfaff <blp@ovn.org> wrote:
> > 
> > From a glance at the prototype it wasn't obvious that it destroyed its
> > argument.
> > 
> > Signed-off-by: Ben Pfaff <blp@ovn.org>
> 
> Acked-by: Justin Pettit <jpettit@ovn.org>

Thanks.  I applied this patch (only) to master.

Patch

diff --git a/lib/jsonrpc.c b/lib/jsonrpc.c
index a8e5bc8434ad..f8786f909ac8 100644
--- a/lib/jsonrpc.c
+++ b/lib/jsonrpc.c
@@ -716,6 +716,9 @@  exit:
     return error;
 }
 
+/* Returns 'm' converted to JSON suitable for sending as a JSON-RPC message.
+ *
+ * Consumes and destroys 'm'. */
 struct json *
 jsonrpc_msg_to_json(struct jsonrpc_msg *m)
 {