mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 12:45:13 +02:00
ACCOUNT/userspace: use bool type
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -22,14 +23,14 @@
|
|||||||
|
|
||||||
#include <libxt_ACCOUNT_cl.h>
|
#include <libxt_ACCOUNT_cl.h>
|
||||||
|
|
||||||
char exit_now;
|
bool exit_now;
|
||||||
static void sig_term(int signr)
|
static void sig_term(int signr)
|
||||||
{
|
{
|
||||||
signal(SIGINT, SIG_IGN);
|
signal(SIGINT, SIG_IGN);
|
||||||
signal(SIGQUIT, SIG_IGN);
|
signal(SIGQUIT, SIG_IGN);
|
||||||
signal(SIGTERM, SIG_IGN);
|
signal(SIGTERM, SIG_IGN);
|
||||||
|
|
||||||
exit_now = 1;
|
exit_now = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *addr_to_dotted(unsigned int);
|
char *addr_to_dotted(unsigned int);
|
||||||
@@ -62,8 +63,9 @@ int main(int argc, char *argv[])
|
|||||||
struct ipt_ACCOUNT_context ctx;
|
struct ipt_ACCOUNT_context ctx;
|
||||||
struct ipt_acc_handle_ip *entry;
|
struct ipt_acc_handle_ip *entry;
|
||||||
int i;
|
int i;
|
||||||
char optchar, doHandleUsage = 0, doHandleFree = 0, doTableNames = 0;
|
char optchar;
|
||||||
char doFlush = 0, doContinue = 0, doCSV = 0;
|
bool doHandleUsage = false, doHandleFree = false, doTableNames = false;
|
||||||
|
bool doFlush = false, doContinue = false, doCSV = false;
|
||||||
|
|
||||||
char *table_name = NULL;
|
char *table_name = NULL;
|
||||||
const char *name;
|
const char *name;
|
||||||
@@ -82,22 +84,22 @@ int main(int argc, char *argv[])
|
|||||||
switch (optchar)
|
switch (optchar)
|
||||||
{
|
{
|
||||||
case 'u':
|
case 'u':
|
||||||
doHandleUsage = 1;
|
doHandleUsage = true;
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
doHandleFree = 1;
|
doHandleFree = true;
|
||||||
break;
|
break;
|
||||||
case 'a':
|
case 'a':
|
||||||
doTableNames = 1;
|
doTableNames = true;
|
||||||
break;
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
doFlush = 1;
|
doFlush = true;
|
||||||
break;
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
doContinue = 1;
|
doContinue = true;
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
doCSV = 1;
|
doCSV = true;
|
||||||
break;
|
break;
|
||||||
case 'l':
|
case 'l':
|
||||||
table_name = strdup(optarg);
|
table_name = strdup(optarg);
|
||||||
@@ -211,7 +213,7 @@ int main(int argc, char *argv[])
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
i++;
|
i++;
|
||||||
} else
|
} else
|
||||||
exit_now = 1;
|
exit_now = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user