diff options
author | Mateusz Kusiak <mateusz.kusiak@intel.com> | 2024-02-20 11:56:08 +0100 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-02-23 12:43:25 +0100 |
commit | 38cb95dd28fa790ae6d90b169f1fd2b1d09a02f2 (patch) | |
tree | ca29407688671262ae89f1039811aa096c1fd12f /mdadm.h | |
parent | Create: add_disk_to_super() fix resource leak (diff) | |
download | mdadm-38cb95dd28fa790ae6d90b169f1fd2b1d09a02f2.tar.xz mdadm-38cb95dd28fa790ae6d90b169f1fd2b1d09a02f2.zip |
mdadm: signal_s() init variables
Init sigaction structs in signal_s().
This approach might throw warnings for GCC 4.x and lower.
Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Diffstat (limited to 'mdadm.h')
-rw-r--r-- | mdadm.h | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; |