A small error message fix in source3/smbd/server.c

Michael Adam obnox at samba.org
Mon Nov 12 01:57:58 MST 2012


On 2012-11-12 at 18:33 +1100, Andrew Bartlett wrote:
> On Mon, 2012-11-12 at 08:25 +0100, Michael Adam wrote:
> > On 2012-11-12 at 17:39 +1100, Andrew Bartlett wrote:
> > > On Mon, 2012-11-12 at 07:34 +0100, Volker Lendecke wrote:
> > > > On Sun, Nov 11, 2012 at 09:18:56AM -0800, Richard Sharpe wrote:
> > > > > Hi folks,
> > > > > 
> > > > > The following patch removes some incorrect info from an error message
> > > > > (probably from its old place when it was copied:
> > > > > 
> > > > > diff --git a/source3/smbd/server.c b/source3/smbd/server.c
> > > > > index 7113eae..f33046b 100644
> > > > > --- a/source3/smbd/server.c
> > > > > +++ b/source3/smbd/server.c
> > > > > @@ -551,7 +551,7 @@ static void smbd_accept_connection(struct tevent_context *ev
> > > > >                 return;
> > > > > 
> > > > >         if (fd == -1) {
> > > > > -               DEBUG(0,("open_sockets_smbd: accept: %s\n",
> > > > > +               DEBUG(0,("accept: %s\n",
> > > > >                          strerror(errno)));
> > > > >                 return;
> > > > >         }
> > > > 
> > > > If you're going there, I'd change the string to 
> > > > 
> > > > "smbd_accept_connection: accept failed: %s\n"
> > > > 
> > > > because the convention at least I see a lot is to have the
> > > > function name that is calling this before the :.
> > > 
> > > Well, we did agree to stop putting function names there,
> > 
> > Oh, when was that? I frankly don't remember.
> > I am asking, because I also quite frequently use this,
> > when I think the __location__ macro is a little too chatty,
> > it also does not list the function name.
> > And the __FUNCTION__ macro does not work on all systems.
> 
> Which systems doesn't it work on?

I can't point at a specific system at this moment, but
the definition in replace is conditional on the existence
of the __func__ macro, so I assume that there are systems
that I don't support it. And when I recently wanted to
use it in a debug message, metzt told me not to, because
it is not portable...

> > > but the patch to change our debug code to always use the
> > > 'header' format that includes the function name and line number
> > > seemed to stall out a few months ago.  
> > 
> > Could you point me to that thread?
> > As I said above, I simply don't remembe a discussion about this.
> 
> Sure:
> https://lists.samba.org/archive/samba-technical/2012-July/085616.html

Ok, I don't see that thread as an agreement.
But certainly something that we should continue discussing.

Cheers - Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 206 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20121112/02517271/attachment.pgp>


More information about the samba-technical mailing list