summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlum <lum@cvs.openbsd.org>2010-06-30 03:32:56 +0000
committerlum <lum@cvs.openbsd.org>2010-06-30 03:32:56 +0000
commitbe131d156fcfa29540d6b94dd7cc5ab44c01cfd6 (patch)
tree6149f757d6bf71f2f9202b2eec993c1eda8e5258
parentdd400b20a9013415bb9ba62699ca37ebaa9fa483 (diff)
Make deprecated command line argument for extracting
name list work properly. ok deraadt@ millert@
-rw-r--r--usr.bin/netstat/main.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 72d4afc3f52..204e58ce0d3 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.83 2010/06/29 03:09:29 blambert Exp $ */
+/* $OpenBSD: main.c,v 1.84 2010/06/30 03:32:55 lum Exp $ */
/* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */
/*
@@ -306,6 +306,24 @@ main(int argc, char *argv[])
exit(0);
}
+#define BACKWARD_COMPATIBILITY
+#ifdef BACKWARD_COMPATIBILITY
+ if (*argv) {
+ if (isdigit(**argv)) {
+ interval = atoi(*argv);
+ if (interval <= 0)
+ usage();
+ ++argv;
+ iflag = 1;
+ }
+ if (*argv) {
+ nlistf = *argv;
+ if (*++argv)
+ memf = *argv;
+ }
+ }
+#endif
+
/*
* Discard setgid privileges if not the running kernel so that bad
* guys can't print interesting stuff from kernel memory.
@@ -326,24 +344,6 @@ main(int argc, char *argv[])
if (setresgid(gid, gid, gid) == -1)
err(1, "setresgid");
-#define BACKWARD_COMPATIBILITY
-#ifdef BACKWARD_COMPATIBILITY
- if (*argv) {
- if (isdigit(**argv)) {
- interval = atoi(*argv);
- if (interval <= 0)
- usage();
- ++argv;
- iflag = 1;
- }
- if (*argv) {
- nlistf = *argv;
- if (*++argv)
- memf = *argv;
- }
- }
-#endif
-
if (kvm_nlist(kvmd, nl) < 0 || nl[0].n_type == 0) {
if (nlistf)
fprintf(stderr, "%s: %s: no namelist\n", __progname,