]> git.tue.mpg.de Git - dss.git/commitdiff
Invalidate all rsync options on SIGHUP.
authorAndre Noll <maan@systemlinux.org>
Mon, 2 Feb 2009 18:23:20 +0000 (19:23 +0100)
committerAndre Noll <maan@systemlinux.org>
Mon, 2 Feb 2009 18:23:20 +0000 (19:23 +0100)
gengetopt's params->override option does not do what its name suggests,
see

http://www.opensubscriber.com/message/help-gengetopt@gnu.org/10980633.html

or
http://www.mail-archive.com/help-gengetopt@gnu.org/msg00507.html

dss.c

diff --git a/dss.c b/dss.c
index c4349a84aa9dae70f4735bd25015568d37a72379..ecf2b3f657c191347d417b52e95cc4fb0bf42fda 100644 (file)
--- a/dss.c
+++ b/dss.c
@@ -620,6 +620,15 @@ static int parse_config_file(int override)
                        .check_ambiguity = 0,
                        .print_errors = 1
                };
+               if (override) { /* invalidate all rsync options */
+                       int i;
+
+                       for (i = 0; i < conf.rsync_option_given; i++) {
+                               free(conf.rsync_option_arg[i]);
+                               conf.rsync_option_arg[i] = NULL;
+                       }
+                       conf.rsync_option_given = 0;
+               }
                cmdline_parser_config_file(config_file, &conf, &params);
        }
        ret = check_config();