From: Karel Zak Date: Thu, 4 Feb 2021 11:54:45 +0000 (+0100) Subject: hardlink: move default to options initialization X-Git-Tag: v2.37-rc1~121 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9e7235e7e07a79c328a5e037c4060e51ec58411c;p=thirdparty%2Futil-linux.git hardlink: move default to options initialization Signed-off-by: Karel Zak --- diff --git a/misc-utils/hardlink.c b/misc-utils/hardlink.c index e93e52a176..3b696f531b 100644 --- a/misc-utils/hardlink.c +++ b/misc-utils/hardlink.c @@ -153,7 +153,15 @@ static struct options { unsigned int keep_oldest:1; unsigned int dry_run:1; unsigned long long min_size; -} opts; +} opts = { + /* default setting */ + .respect_mode = TRUE, + .respect_owner = TRUE, + .respect_time = TRUE, + .respect_xattrs = FALSE, + .keep_oldest = FALSE, + .min_size = 1 +}; /* * files @@ -968,12 +976,6 @@ static int parse_options(int argc, char *argv[]) int opt; char unit = '\0'; - opts.respect_mode = TRUE; - opts.respect_owner = TRUE; - opts.respect_time = TRUE; - opts.respect_xattrs = FALSE; - opts.keep_oldest = FALSE; - opts.min_size = 1; while ((opt = getopt_long(argc, argv, optstr, long_options, NULL)) != -1) { switch (opt) {