summaryrefslogtreecommitdiffstats
path: root/monitor.c
diff options
context:
space:
mode:
authorMateusz Kusiak <mateusz.kusiak@intel.com>2024-01-18 11:28:41 +0100
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-01-24 16:15:04 +0100
commitb823c8f9d65eb7cf3338036c2a3fedf5128dedbc (patch)
tree52bc23321dfa6a50733389b78e7e1f3f2ef5d363 /monitor.c
parentDefine sysfs max buffer size (diff)
downloadmdadm-b823c8f9d65eb7cf3338036c2a3fedf5128dedbc.tar.xz
mdadm-b823c8f9d65eb7cf3338036c2a3fedf5128dedbc.zip
Replace "none" with macro
String "none" is used many times throughout the code. Replace "none" strings with predefined macro. Add str_is_none() for comparing strings with "none". Replace str(n)cmp calls with function. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com> Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/monitor.c b/monitor.c
index f54d07b2..4acec678 100644
--- a/monitor.c
+++ b/monitor.c
@@ -89,7 +89,7 @@ static void read_resync_start(int fd, unsigned long long *v)
dprintf("Failed to read resync_start (%d)\n", fd);
return;
}
- if (strncmp(buf, "none", 4) == 0)
+ if (str_is_none(buf) == true)
*v = MaxSector;
else
*v = strtoull(buf, NULL, 10);
@@ -600,7 +600,7 @@ static int read_and_act(struct active_array *a, fd_set *fds)
"reshape_position",
buf,
sizeof(buf)) >= 0) &&
- strncmp(buf, "none", 4) == 0)
+ str_is_none(buf) == true)
a->last_checkpoint = a->info.component_size;
}
a->container->ss->set_array_state(a, a->curr_state <= clean);