[PATCH 2/6] mdadm: signal_s() init variables

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

 



Init sigaction structs in signal_s().
This approach might throw warnings for GCC 4.x and lower.

Signed-off-by: Mateusz Kusiak <mateusz.kusiak@xxxxxxxxx>
---
 mdadm.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mdadm.h b/mdadm.h
index 1f28b3e754be..75c887e4c64c 100644
--- a/mdadm.h
+++ b/mdadm.h
@@ -1856,11 +1856,10 @@ static inline char *to_subarray(struct mdstat_ent *ent, char *container)
  */
 static inline sighandler_t signal_s(int sig, sighandler_t handler)
 {
-	struct sigaction new_act;
-	struct sigaction old_act;
+	struct sigaction new_act = {0};
+	struct sigaction old_act = {0};
 
 	new_act.sa_handler = handler;
-	new_act.sa_flags = 0;
 
 	if (sigaction(sig, &new_act, &old_act) == 0)
 		return old_act.sa_handler;
-- 
2.35.3





[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