From 14839ad22bf671382d464c493d82e6ee0c629c07 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 12 Jan 2011 09:20:14 +0000 Subject: [PATCH] fixes --- src/transport/gnunet-transport-wlan-helper.c | 30 +++++++------------- 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/src/transport/gnunet-transport-wlan-helper.c b/src/transport/gnunet-transport-wlan-helper.c index feb30deb6..7ac2915b4 100644 --- a/src/transport/gnunet-transport-wlan-helper.c +++ b/src/transport/gnunet-transport-wlan-helper.c @@ -138,7 +138,7 @@ Dump(u8 * pu8, int nLength) void -usage(void) +usage() { printf( "Usage: wlan-hwd [options] \n\nOptions\n" @@ -397,25 +397,18 @@ int ieee80211_radiotap_iterator_next( #define FIFO_FILE2 "/tmp/MYFIFOout" #define MAXLINE 20 -int first; -int closeprog = 0; +static int first; +static int closeprog; -void sigfunc(int sig) +static void +sigfunc(int sig) { - - if(sig != SIGINT || sig != SIGTERM || sig != SIGKILL) - return; - else - { - closeprog = 1; - - unlink(FIFO_FILE1); - unlink(FIFO_FILE2); - - } + closeprog = 1; + unlink(FIFO_FILE1); + unlink(FIFO_FILE2); } -struct sendbuf{ +struct sendbuf { int pos; int size; char buf[MAXLINE * 2]; @@ -517,9 +510,8 @@ testmode(int argc, char *argv[]) fdpin = fileno(fpin); fdpout = fileno(fpout); - signal(SIGINT, sigfunc); - signal(SIGTERM, sigfunc); - signal(SIGKILL, sigfunc); + signal(SIGINT, &sigfunc); + signal(SIGTERM, &sigfunc); char readbuf[MAXLINE]; int readsize = 0; -- 2.25.1