global_opts in rsync

Dave Dykstra dwd at bell-labs.com
Tue Dec 18 01:29:31 EST 2001


On Mon, Dec 17, 2001 at 11:18:12AM +1100, Martin Pool wrote:
> Subject: Re: CVS update: rsync
> On 14 Dec 2001, dwd at samba.org wrote:
> 
> > Modified Files:
> > 	options.c 
> > Log Message:
> > When INET6 is not defined, meaning that IPv6 is not supported, need to
> > initalize the global_opts.af_hint to AF_INET or systems such as Linux that
> > have a native getaddrinfo() because they support IPv6 will attempt to
> > create IPv6 sockets.  This brings up a problem with the new global_opts
> > structure; in order to initialize them to a value other than 0, we need to
> > explicitly initialize them all in an order that matches the order in
> > rsync.h.  I think that's more inconvenient & error prone than keeping
> > global variables.
> 
> I see your point...  Should we get rid of it, or add an initialization
> function?

Either way would work, but I vote for getting rid of global_opts.  It's
simpler.  Also, it's more consistent.  If you keep global_opts, to be
consistent someday you'd need to go through all the command line options
and change everywhere the variables are referenced to be "global_opts.var"
rather than just "var".  I can't see any advantage to going through that
effort.

If it's just all the "extern var" statements that are scattered around that
are the pain, I do see an advantage to putting all of those in rsync.h and
removing them from the .c files.

- Dave




More information about the rsync mailing list