On Mon, 2009-04-27 at 12:41 +0200, Paul Slootman wrote:
> On Mon 27 Apr 2009, Daniel.Li wrote:
> > 
> > I'm confused when we will run into "if (motd && *motd)"? 
> > 
> > As I have found that Globals is set 0 during initialization, and I
> > didn't find anywhere else assign the value.
> 
> > clientserver.c #line 147~160
> > >   if (!am_client) {
> > >           motd = lp_motd_file();
>                 ^^^^^^^^^^^^^^^^^^^^^^
> > >           if (motd && *motd) {
> 
> It's being assigned the line above the (motd && *motd) part!

Sorry, I forgot to paste below macros. Yes, it's assigned, but this
function just returns default("") or global values. But it seems never
assigned.

loadparam.c #line 394

> FN_GLOBAL_STRING(lp_motd_file, &Globals.motd_file)

loadparam.c #line 374~375


> #define FN_GLOBAL_STRING(fn_name,ptr) \
>  char *fn_name(void) {return(*(char **)(ptr) ? *(char **)(ptr) : "");}

So the function will return "" or it's assigned value.
char *lp_motd_file(void)
{
return(*(char **)(&Globals.motd_file) ? *(char **)(&Globals.motd_file) :
"");
}
> 
> 
> Paul
-- 
Daniel

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to