[PATCH] s3: smbd: Modernize Avahi DEBUG macros and long if statements

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] s3: smbd: Modernize Avahi DEBUG macros and long if statements

Samba - samba-technical mailing list
Hi all,

This patch modernizes the DEBUG macros and breaks up long if statements in the smbd Avahi code.
It paves the way for adding advertisement of _adisk._tcp when fruit:time machine is enabled, as part of the Time Machine/FULLSYNC patch.

Would it be useful to do a search throughout the code for old-style DEBUG macros and replace them with the modern equivalent?
I also recall seeing different DEBUG levels for the same conditions (allocation failure/OOM in the specific case I was looking at)—is there a standard for what levels should be used?
I suppose it would come down to whether allocation failure/OOM requires an error, a warning, or a notice.

Thanks!
Omri

0001-s3-smbd-Modernize-Avahi-DEBUG-macros-and-long-if-sta.patch (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] s3: smbd: Modernize Avahi DEBUG macros and long if statements

Samba - samba-technical mailing list
On Wed, Jul 26, 2017 at 05:38:38PM -0700, Omri Mor via samba-technical wrote:
> This patch modernizes the DEBUG macros and breaks up long if
> statements in the smbd Avahi code.

If you use DBG_DEBUG() instead of DEBUG(10, ()), you get the function
name prefix for free.

Volker

--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] s3: smbd: Modernize Avahi DEBUG macros and long if statements

Samba - samba-technical mailing list
> If you use DBG_DEBUG() instead of DEBUG(10, ()), you get the function
> name prefix for free.
>
> Volker

I did not realize that some of the DEBUG(10, ()) users had prefixed the function name.
Here’s a new version fixing that.
I also realized that the various avahi_entry_group_*() functions return the error directly, so there isn’t a need for a separate ret variable (or for calls to avahi_client_errno()).

Thanks for the input!
Omri

0001-s3-smbd-Modernize-Avahi-DEBUG-macros-and-long-if-sta.patch (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] s3: smbd: Modernize Avahi DEBUG macros and long if statements

Samba - samba-technical mailing list
On Thu, Jul 27, 2017 at 02:34:22AM -0700, Omri Mor wrote:
> I did not realize that some of the DEBUG(10, ()) users had prefixed the function name.
> Here’s a new version fixing that.
> I also realized that the various avahi_entry_group_*() functions return the error directly, so there isn’t a need for a separate ret variable (or for calls to avahi_client_errno()).
>


Reviewed-by: Volker Lendecke <[hidden email]>

Another team reviewer around?

Thanks, Volker

--
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:[hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] s3: smbd: Modernize Avahi DEBUG macros and long if statements

Samba - samba-technical mailing list
On Thu, Jul 27, 2017 at 01:02:21PM +0200, Volker Lendecke via samba-technical wrote:
> Reviewed-by: Volker Lendecke <[hidden email]>
>
> Another team reviewer around?

lgtm. Pushed to autobuild.

-slow

Loading...