[PATCH] mdadm: modify the variable used in the set_bitmap_value()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The function set_bitmap_value() argument is val, and optarg is a global variable.
To ensure the function's independence, modify optarg to val.

Signed-off-by: Wu Guanghao <wuguanghao3@xxxxxxxxxx>
---
 mdadm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mdadm.c b/mdadm.c
index 50d39f67..142d2873 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -46,7 +46,7 @@ static mdadm_status_t set_bitmap_value(struct shape *s, struct context *c, char
 		return MDADM_STATUS_ERROR;
 	}

-	if (strcmp(optarg, STR_COMMON_NONE) == 0) {
+	if (strcmp(val, STR_COMMON_NONE) == 0) {
 		s->btype = BitmapNone;
 		return MDADM_STATUS_SUCCESS;
 	}
-- 
2.45.2




[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux