summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJes Sorensen <jsorensen@fb.com>2017-05-11 22:40:16 +0200
committerJes Sorensen <jsorensen@fb.com>2017-05-11 22:40:16 +0200
commit9f3dd4549b2b904d343b79a8a7ba40c547e71d5d (patch)
tree3363f088f2605a16e1e6a4bb0337b29d082efd15
parentretire the APIs that driver no longer supports (diff)
downloadmdadm-9f3dd4549b2b904d343b79a8a7ba40c547e71d5d.tar.xz
mdadm-9f3dd4549b2b904d343b79a8a7ba40c547e71d5d.zip
Monitor: Not much point declaring mdlist in both forks of the if() statement
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r--Monitor.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Monitor.c b/Monitor.c
index 5b958478..a4afe751 100644
--- a/Monitor.c
+++ b/Monitor.c
@@ -127,6 +127,7 @@ int Monitor(struct mddev_dev *devlist,
struct mdstat_ent *mdstat = NULL;
char *mailfrom = NULL;
struct alert_info info;
+ struct mddev_ident *mdlist;
if (!mailaddr) {
mailaddr = conf_get_mailaddr();
@@ -162,7 +163,7 @@ int Monitor(struct mddev_dev *devlist,
return 1;
if (devlist == NULL) {
- struct mddev_ident *mdlist = conf_get_ident(NULL);
+ mdlist = conf_get_ident(NULL);
for (; mdlist; mdlist=mdlist->next) {
struct state *st;
if (mdlist->devname == NULL)
@@ -189,8 +190,8 @@ int Monitor(struct mddev_dev *devlist,
} else {
struct mddev_dev *dv;
for (dv=devlist ; dv; dv=dv->next) {
- struct mddev_ident *mdlist = conf_get_ident(dv->devname);
struct state *st = xcalloc(1, sizeof *st);
+ mdlist = conf_get_ident(dv->devname);
st->devname = xstrdup(dv->devname);
st->next = statelist;
st->devnm[0] = 0;