summaryrefslogtreecommitdiff
path: root/clientserver.c
diff options
context:
space:
mode:
authorMartin Pool <mbp@samba.org>2001-12-18 05:54:57 +0000
committerMartin Pool <mbp@samba.org>2001-12-18 05:54:57 +0000
commit13e29995f5f08300ea946374079dff50f8cb6bd7 (patch)
tree4aeee288eee2e5088db7eabc1cfd06e30d239e82 /clientserver.c
parent7c583c73160714a2f61034515adb1a4a32f9d818 (diff)
downloadrsync-13e29995f5f08300ea946374079dff50f8cb6bd7.tar.gz
Get rid of global_opts struct as suggested by Dave -- too many
problems with initialization. Change the algorithm from trying to open an inbound socket with getaddrinfo: keep trying suggested addresses until we find one on which we can both get a socket and bind. Not convinced this is the best, but it's probably better.
Diffstat (limited to 'clientserver.c')
-rw-r--r--clientserver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/clientserver.c b/clientserver.c
index 1b3801bc..73893764 100644
--- a/clientserver.c
+++ b/clientserver.c
@@ -45,6 +45,7 @@ int start_socket_client(char *host, char *path, int argc, char *argv[])
extern char *shell_cmd;
extern int kludge_around_eof;
extern char *bind_address;
+ extern int default_af_hint;
if (argc == 0 && !am_sender) {
extern int list_only;
@@ -79,7 +80,7 @@ int start_socket_client(char *host, char *path, int argc, char *argv[])
if (!user) user = getenv("LOGNAME");
fd = open_socket_out_wrapped (host, rsync_port, bind_address,
- global_opts.af_hint);
+ default_af_hint);
if (fd == -1) {
exit_cleanup(RERR_SOCKETIO);
}
@@ -486,6 +487,7 @@ int daemon_main(void)
extern char *config_file;
extern int orig_umask;
char *pid_file;
+ extern int no_detach;
if (is_a_socket(STDIN_FILENO)) {
int i;
@@ -501,7 +503,7 @@ int daemon_main(void)
return start_daemon(STDIN_FILENO);
}
- if (!global_opts.no_detach)
+ if (!no_detach)
become_daemon();
if (!lp_load(config_file, 1)) {