=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/netstat/main.c,v retrieving revision 1.61 retrieving revision 1.62 diff -c -r1.61 -r1.62 *** src/usr.bin/netstat/main.c 2005/07/04 01:54:10 1.61 --- src/usr.bin/netstat/main.c 2006/05/27 19:16:37 1.62 *************** *** 1,4 **** ! /* $OpenBSD: main.c,v 1.61 2005/07/04 01:54:10 djm Exp $ */ /* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: main.c,v 1.62 2006/05/27 19:16:37 claudio Exp $ */ /* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */ /* *************** *** 40,46 **** #if 0 static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 3/1/94"; #else ! static char *rcsid = "$OpenBSD: main.c,v 1.61 2005/07/04 01:54:10 djm Exp $"; #endif #endif /* not lint */ --- 40,46 ---- #if 0 static char sccsid[] = "from: @(#)main.c 8.4 (Berkeley) 3/1/94"; #else ! static char *rcsid = "$OpenBSD: main.c,v 1.62 2006/05/27 19:16:37 claudio Exp $"; #endif #endif /* not lint */ *************** *** 396,402 **** if (nlistf != NULL || memf != NULL || Pflag) if (setresgid(gid, gid, gid) == -1) err(1, "setresgid"); ! if ((kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf)) == NULL) { fprintf(stderr, "%s: kvm_open: %s\n", __progname, buf); --- 396,411 ---- if (nlistf != NULL || memf != NULL || Pflag) if (setresgid(gid, gid, gid) == -1) err(1, "setresgid"); ! if (nlistf == NULL && memf == NULL && rflag && !Aflag) { ! /* printing the routing table no longer needs kvm */ ! if (setresgid(gid, gid, gid) == -1) ! err(1, "setresgid"); ! if (sflag) ! rt_stats(1, 0); ! else ! p_rttables(af); ! exit(0); ! } if ((kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf)) == NULL) { fprintf(stderr, "%s: kvm_open: %s\n", __progname, buf); *************** *** 466,472 **** } if (rflag) { if (sflag) ! rt_stats(nl[N_RTSTAT].n_value); else routepr(nl[N_RTREE].n_value); exit(0); --- 475,481 ---- } if (rflag) { if (sflag) ! rt_stats(0, nl[N_RTSTAT].n_value); else routepr(nl[N_RTREE].n_value); exit(0);