diff options
author | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2022-12-21 12:50:17 +0100 |
---|---|---|
committer | Jes Sorensen <jes@trained-monkey.org> | 2022-12-28 16:04:12 +0100 |
commit | 7fcbfd7c620e2dcd3b539d18e93cb503ee3a8a62 (patch) | |
tree | 35917bd04b566376504a8dc0c96171a1aae2b3a7 /mdadm.c | |
parent | Grow: fix possible memory leak. (diff) | |
download | mdadm-7fcbfd7c620e2dcd3b539d18e93cb503ee3a8a62.tar.xz mdadm-7fcbfd7c620e2dcd3b539d18e93cb503ee3a8a62.zip |
mdadm: create ident_init()
Add a wrapper for repeated initializations in mdadm.c and config.c.
Move includes up.
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Signed-off-by: Jes Sorensen <jes@trained-monkey.org>
Diffstat (limited to 'mdadm.c')
-rw-r--r-- | mdadm.c | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -107,25 +107,13 @@ int main(int argc, char *argv[]) srandom(time(0) ^ getpid()); - ident.uuid_set = 0; - ident.level = UnSet; - ident.raid_disks = UnSet; - ident.super_minor = UnSet; - ident.devices = 0; - ident.spare_group = NULL; - ident.autof = 0; - ident.st = NULL; - ident.bitmap_fd = -1; - ident.bitmap_file = NULL; - ident.name[0] = 0; - ident.container = NULL; - ident.member = NULL; - if (get_linux_version() < 2006015) { pr_err("This version of mdadm does not support kernels older than 2.6.15\n"); exit(1); } + ident_init(&ident); + while ((option_index = -1), (opt = getopt_long(argc, argv, shortopt, long_options, &option_index)) != -1) { |