From 0aad45593fb139aeabc19b79faecfe769b671f63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joan=20Lled=C3=B3?= Date: Fri, 16 Aug 2019 08:40:24 +0200 Subject: [PATCH] Unix port: sio module: memset struct sigaction to 0 * Use memset to set all struct sigaction fields to 0 instead of doing it field by field, since fields depend on the architecture. --- contrib/ports/unix/port/netif/sio.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/contrib/ports/unix/port/netif/sio.c b/contrib/ports/unix/port/netif/sio.c index d5a38af1..185a4eca 100644 --- a/contrib/ports/unix/port/netif/sio.c +++ b/contrib/ports/unix/port/netif/sio.c @@ -131,6 +131,7 @@ static int sio_init( char * device, int devnum, sio_status_t * siostat ) } #if ! (PPP_SUPPORT || LWIP_HAVE_SLIPIF) + memset(&saio, 0, sizeof(struct sigaction)); /* install the signal handler before making the device asynchronous */ switch ( devnum ) { @@ -147,10 +148,6 @@ static int sio_init( char * device, int devnum, sio_status_t * siostat ) break; } - saio.sa_flags = 0; -#if defined(LWIP_UNIX_LINUX) - saio.sa_restorer = NULL; -#endif /* LWIP_UNIX_LINUX */ sigaction( SIGIO,&saio,NULL ); /* allow the process to receive SIGIO */