diff options
author | ru <ru@FreeBSD.org> | 2000-10-11 13:02:30 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2000-10-11 13:02:30 +0000 |
commit | 721d9c664e367935d60dba3f4257f21f3ab729d0 (patch) | |
tree | 1d79164343cff38979030527db7df3b79b74e0db /sbin | |
parent | fcb6e94f1169a127d14fc622f805b4db71b8474d (diff) | |
download | FreeBSD-src-721d9c664e367935d60dba3f4257f21f3ab729d0.zip FreeBSD-src-721d9c664e367935d60dba3f4257f21f3ab729d0.tar.gz |
Reset globals for every new command read from preprocessed file.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ipfw/ipfw.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/sbin/ipfw/ipfw.c b/sbin/ipfw/ipfw.c index 0c0f02a..1923efd 100644 --- a/sbin/ipfw/ipfw.c +++ b/sbin/ipfw/ipfw.c @@ -58,17 +58,15 @@ static const char rcsid[] = #include <netinet/tcp.h> #include <arpa/inet.h> -int lineno = -1; - -int s; /* main RAW socket */ -int do_resolv=0; /* Would try to resolve all */ -int do_acct=0; /* Show packet/byte count */ -int do_time=0; /* Show time stamps */ -int do_quiet=0; /* Be quiet in add and flush */ -int do_force=0; /* Don't ask for confirmation */ -int do_pipe=0; /* this cmd refers to a pipe */ -int do_sort=0; /* field to sort results (0=no) */ -int verbose=0; +int s, /* main RAW socket */ + do_resolv, /* Would try to resolve all */ + do_acct, /* Show packet/byte count */ + do_time, /* Show time stamps */ + do_quiet, /* Be quiet in add and flush */ + do_force, /* Don't ask for confirmation */ + do_pipe, /* this cmd refers to a pipe */ + do_sort, /* field to sort results (0=no) */ + verbose; struct icmpcode { int code; @@ -2230,6 +2228,10 @@ ipfw_main(ac,av) show_usage(NULL); } + /* Initialize globals. */ + do_resolv = do_acct = do_time = do_quiet = + do_pipe = do_sort = verbose = 0; + /* Set the force flag for non-interactive processes */ do_force = !isatty(STDIN_FILENO); @@ -2347,7 +2349,7 @@ main(ac, av) char buf[BUFSIZ]; char *a, *p, *args[MAX_ARGS], *cmd = NULL; char linename[10]; - int i, c, qflag, pflag, status; + int i, c, lineno, qflag, pflag, status; FILE *f = NULL; pid_t preproc = 0; |