Unlimited Usenet
day retention, 99% Completion, Unlimited Access, Free Trial!

Re: [Code study]should we remove if (motd && *motd) section?

This is a discussion on Re: [Code study]should we remove if (motd && *motd) section? within the Rsync forums, part of the Networking and Network Related category; On Mon, 2009-04-27 at 12:41 +0200, Paul Slootman wrote: > On Mon 27 Apr 2009, Daniel.Li ...


Go Back   Usenet Forums > Networking and Network Related > Rsync

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-27-2009
Daniel.Li
 
Posts: n/a
Default Re: [Code study]should we remove if (motd && *motd) section?

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 With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:15 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0