void
-usage(void)
+usage()
{
printf(
"Usage: wlan-hwd [options] <interface>\n\nOptions\n"
#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];
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;