=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/netstat/unix.c,v retrieving revision 1.13 retrieving revision 1.14 diff -c -r1.13 -r1.14 *** src/usr.bin/netstat/unix.c 2007/12/19 01:47:00 1.13 --- src/usr.bin/netstat/unix.c 2010/04/28 18:22:11 1.14 *************** *** 1,4 **** ! /* $OpenBSD: unix.c,v 1.13 2007/12/19 01:47:00 deraadt Exp $ */ /* $NetBSD: unix.c,v 1.13 1995/10/03 21:42:48 thorpej Exp $ */ /*- --- 1,4 ---- ! /* $OpenBSD: unix.c,v 1.14 2010/04/28 18:22:11 jsg Exp $ */ /* $NetBSD: unix.c,v 1.13 1995/10/03 21:42:48 thorpej Exp $ */ /*- *************** *** 57,63 **** static void unixdomainpr(struct socket *, caddr_t); static struct file *file, *fileNFILE; ! static int nfiles; extern kvm_t *kvmd; void --- 57,63 ---- static void unixdomainpr(struct socket *, caddr_t); static struct file *file, *fileNFILE; ! static int fcnt; extern kvm_t *kvmd; void *************** *** 68,80 **** char *filebuf; struct protosw *unixsw = (struct protosw *)off; ! filebuf = kvm_getfiles(kvmd, KERN_FILE, 0, &nfiles); if (filebuf == NULL) { printf("Out of memory (file table).\n"); return; } file = (struct file *)(filebuf + sizeof(fp)); ! fileNFILE = file + nfiles; for (fp = file; fp < fileNFILE; fp++) { if (fp->f_count == 0 || fp->f_type != DTYPE_SOCKET) continue; --- 68,80 ---- char *filebuf; struct protosw *unixsw = (struct protosw *)off; ! filebuf = kvm_getfiles(kvmd, KERN_FILE, 0, &fcnt); if (filebuf == NULL) { printf("Out of memory (file table).\n"); return; } file = (struct file *)(filebuf + sizeof(fp)); ! fileNFILE = file + fcnt; for (fp = file; fp < fileNFILE; fp++) { if (fp->f_count == 0 || fp->f_type != DTYPE_SOCKET) continue;