]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hardlink: move default to options initialization
authorKarel Zak <kzak@redhat.com>
Thu, 4 Feb 2021 11:54:45 +0000 (12:54 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 17 Feb 2021 10:50:21 +0000 (11:50 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/hardlink.c

index e93e52a1765c5676acec02da8d27036c7a2a9dec..3b696f531b061a883965dc081b7e39fa3e2c6cf8 100644 (file)
@@ -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) {