[PATCH] ctdb protocol fixes

Martin Schwenke martin at meltin.net
Wed Nov 25 00:47:36 UTC 2015


On Tue, 24 Nov 2015 16:38:44 -0800, Jeremy Allison <jra at samba.org>
wrote:

> On Wed, Nov 25, 2015 at 11:34:45AM +1100, Martin Schwenke wrote:
> > On Tue, 24 Nov 2015 16:21:44 -0800, Jeremy Allison <jra at samba.org>
> > wrote:
> >   
> > > On Tue, Nov 24, 2015 at 05:37:16PM +1100, Amitay Isaacs wrote:  
>  [...]  
> > > 
> > > Just one quick comment, shouldn't:
> > > 
> > > Subject: [PATCH 04/10] ctdb-protocol: Add utility function
> > >  ctdb_sock_addr_to_string
> > > 
> > > make ctdb_sock_addr_to_string() return a const char *,
> > > not a char * ?
> > > 
> > > All the places I see currently using ctdb_addr_to_str()
> > > would work with a const char *, and don't need a char *.
> > > 
> > > I just get nervous when I see:
> > > 
> > >  discard_const("Memory Error");
> > > 
> > > But this is not a blocker (just trying to keep the
> > > code clean :-).  
> > 
> > Darn, I've just pushed.  I'll try to get it out of the queue.
> > 
> > I'll try this out and if it is an easy change do you want me to add
> > your Reviewed-by: to the patch set?  
> 
> No that's fine.
> 
> > If I re-push quickly enough then it won't get started before yours
> > finishes...  :-)  
> 
> You can always just change the ctdb_sock_addr_to_string() interface
> with an additional patch on top. If I'm right it shouldn't change
> much other code.

I tried this out.  I added a "const" to the return value and dropped
the discard_const().  It seems that simple - everything compiles, no
new warnings or errors...  

I'm happy to re-push with that change or leave it as an additional
change... whatever...  :-)

peace & happiness,
martin



More information about the samba-technical mailing list