Devnm shall not be changed inside mdmon_running() and mdmon_pid() functions, change this parameter to const. Signed-off-by: Kinga Stefaniuk <kinga.stefaniuk@xxxxxxxxx> --- mdadm.h | 4 ++-- util.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mdadm.h b/mdadm.h index ae2106a2f28f..af4c484afdf7 100644 --- a/mdadm.h +++ b/mdadm.h @@ -1767,8 +1767,8 @@ extern int is_subarray_active(char *subarray, char *devname); extern int open_subarray(char *dev, char *subarray, struct supertype *st, int quiet); extern struct superswitch *version_to_superswitch(char *vers); -extern int mdmon_running(char *devnm); -extern int mdmon_pid(char *devnm); +extern int mdmon_running(const char *devnm); +extern int mdmon_pid(const char *devnm); extern int check_env(char *name); extern __u32 random32(void); extern void random_uuid(__u8 *buf); diff --git a/util.c b/util.c index 9e8370450a8d..65056a19e2cd 100644 --- a/util.c +++ b/util.c @@ -1891,7 +1891,7 @@ unsigned long long min_recovery_start(struct mdinfo *array) return recovery_start; } -int mdmon_pid(char *devnm) +int mdmon_pid(const char *devnm) { char path[100]; char pid[10]; @@ -1911,7 +1911,7 @@ int mdmon_pid(char *devnm) return atoi(pid); } -int mdmon_running(char *devnm) +int mdmon_running(const char *devnm) { int pid = mdmon_pid(devnm); if (pid <= 0) -- 2.35.3