mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
virnetdaemon.c: Use struct zero initializer instead of memset
Ideally, these would be fixed by coccinelle (see next commit), but because of various reasons they aren't. Fix them manually. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Claudio Fontana <cfontana@suse.de>
This commit is contained in:
parent
3b95df9eda
commit
7ce0fbccf1
@ -134,7 +134,7 @@ virNetDaemonNew(void)
|
||||
{
|
||||
virNetDaemon *dmn;
|
||||
#ifndef WIN32
|
||||
struct sigaction sig_action;
|
||||
struct sigaction sig_action = { 0 };
|
||||
#endif /* !WIN32 */
|
||||
|
||||
if (virNetDaemonInitialize() < 0)
|
||||
@ -160,7 +160,6 @@ virNetDaemonNew(void)
|
||||
dmn->autoShutdownTimerID = -1;
|
||||
|
||||
#ifndef WIN32
|
||||
memset(&sig_action, 0, sizeof(sig_action));
|
||||
sig_action.sa_handler = SIG_IGN;
|
||||
sigaction(SIGPIPE, &sig_action, NULL);
|
||||
#endif /* !WIN32 */
|
||||
@ -599,12 +598,10 @@ virNetDaemonSignalHandler(int sig, siginfo_t * siginfo,
|
||||
{
|
||||
int origerrno;
|
||||
int r;
|
||||
siginfo_t tmp;
|
||||
siginfo_t tmp = { 0 };
|
||||
|
||||
if (SA_SIGINFO)
|
||||
tmp = *siginfo;
|
||||
else
|
||||
memset(&tmp, 0, sizeof(tmp));
|
||||
|
||||
/* set the sig num in the struct */
|
||||
tmp.si_signo = sig;
|
||||
|
Loading…
Reference in New Issue
Block a user