summaryrefslogtreecommitdiff
path: root/sbin/pfctl/pfctl.c
diff options
context:
space:
mode:
authorNiels Provos <provos@cvs.openbsd.org>2001-06-26 22:18:18 +0000
committerNiels Provos <provos@cvs.openbsd.org>2001-06-26 22:18:18 +0000
commit39fda01be9ec2513f38417e36bd6b9ad574c2b97 (patch)
tree0278ba4ec51b95b3e0cf03520561fadf2ca22dde /sbin/pfctl/pfctl.c
parent29ea70dd335161bdad1d038cf45904238a4754e2 (diff)
some warnx, and exit instead of return
Diffstat (limited to 'sbin/pfctl/pfctl.c')
-rw-r--r--sbin/pfctl/pfctl.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c
index da2eb7cd3e6..86aadbea9c3 100644
--- a/sbin/pfctl/pfctl.c
+++ b/sbin/pfctl/pfctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfctl.c,v 1.14 2001/06/26 20:50:26 dhartmei Exp $ */
+/* $OpenBSD: pfctl.c,v 1.15 2001/06/26 22:18:17 provos Exp $ */
/*
* Copyright (c) 2001, Daniel Hartmeier
@@ -43,6 +43,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
+#include <err.h>
#include "pfctl_parser.h"
@@ -454,8 +455,10 @@ main(int argc, char *argv[])
} else if (!strcmp(clearopt, "states")) {
if (pfctl_clear_states(dev))
error = 1;
- } else
+ } else {
+ warnx("Unknown keyword '%s'", clearopt);
error = 1;
+ }
}
if (rulesopt != NULL)
@@ -479,8 +482,10 @@ main(int argc, char *argv[])
} else if (!strcmp(showopt, "status")) {
if (pfctl_show_status(dev))
error = 1;
- } else
+ } else {
+ warnx("Unknown keyword '%s'", showopt);
error = 1;
+ }
}
if (logopt != NULL)
@@ -492,5 +497,6 @@ main(int argc, char *argv[])
error = 1;
close(dev);
- return (error);
+
+ exit(error);
}