Fixing the many DEBUG statements that have confusing info ...

Volker Lendecke Volker.Lendecke at SerNet.DE
Sun Oct 11 08:27:53 UTC 2015


On Sat, Oct 10, 2015 at 09:09:03PM -0700, Richard Sharpe wrote:
> Hi folks,
> 
> I thought I would spend some time fixing DEBUG statements using this idiom:
> 
> @@ -705,8 +705,8 @@ static bool smbd_open_one_socket(struct smbd_parent_context
> *parent,
>         ifss,
>         true);
>   if (s->fd == -1) {
> - DEBUG(0,("smbd_open_one_socket: open_socket_in: "
> - "%s\n", strerror(errno)));
> + DEBUG(0,("%s: open_socket_in: %s\n",
> + __func__, strerror(errno)));
>   TALLOC_FREE(s);
>   /*
>   * We ignore an error here, as we've done before
> 
> where we use %s and __func__.
> 
> However, then I looked at a log file, and saw the following:
> 
> [2015/09/27 03:37:05.961482, 10, pid=13547, effective(0, 0), real(0,
> 0)] ../source3/lib/messages_dgm.c:403(messaging_dgm_wipe)
>   messaging_dgm_cleanup(12521) returned Resource temporarily unavailable
> 
> That is, we already print the source file name, line number and the
> function name. (And the debug message the produced that has gotten out
> of sync with the actual location.)
> 
> Why should we duplicate that info. Surely it is better to simply
> eliminate the function names from DEBUG messages.

Try smbd -d10 -i or any commandline tool.

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:kontakt at sernet.de



More information about the samba-technical mailing list