From 6ab6d4bfc11512565c77ee6ab322b4e214d2074d Mon Sep 17 00:00:00 2001 From: David Dykstra Date: Fri, 14 Dec 2001 18:25:51 +0000 Subject: [PATCH] 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. --- options.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/options.c b/options.c index 4f2f5284..9bb22f45 100644 --- a/options.c +++ b/options.c @@ -75,7 +75,14 @@ int modify_window=0; int blocking_io=0; /** Global options set from command line. **/ -struct global_opts global_opts; +struct global_opts global_opts = { +#ifdef INET6 + 0, /* af_hint -- allow any protocol */ +#else + AF_INET, /* af_hint -- prefer IPv4 */ +#endif + 0, /* no_detach */ +}; int read_batch=0; /* dw */ int write_batch=0; /* dw */ -- 2.34.1