> When running the fstat command on a file, it no longer restricts
> reports to the specified file, e.g.
>
> fstat /var/log/messages
>
> This used to return a line referencing syslogd, now it returns all
> of the internet, internet6, kqueue, pipe, route, and unix sockets
> open on the system as well.
>
> This worked in previous releases, and in snapshots up to at least
> OpenBSD 4.5-current (GENERIC) #41: Sat Jun 6 13:27:32 MDT 2009
>
> Based on the timing, I'd guess this is related to changing fstat
> to use the new kvm_getfile2 interface.
> http://marc.info/?l=openbsd-cvs&m=124434434417337&w=2
The following diff should fix it.
Miod
Index: fstat.c
===================================================================
RCS file: /cvs/src/usr.bin/fstat/fstat.c,v
retrieving revision 1.66
diff -u -p -r1.66 fstat.c
--- fstat.c 11 Jun 2009 21:09:46 -0000 1.66
+++ fstat.c 14 Jun 2009 14:44:08 -0000
@@ -278,19 +278,24 @@ dofiles(struct kinfo_file2 *kf)
vtrans(kf);
break;
case DTYPE_SOCKET:
- socktrans(kf);
+ if (checkfile == 0)
+ socktrans(kf);
break;
case DTYPE_PIPE:
- pipetrans(kf);
+ if (checkfile == 0)
+ pipetrans(kf);
break;
case DTYPE_KQUEUE:
- kqueuetrans(kf);
+ if (checkfile == 0)
+ kqueuetrans(kf);
break;
case DTYPE_CRYPTO:
- cryptotrans(kf);
+ if (checkfile == 0)
+ cryptotrans(kf);
break;
case DTYPE_SYSTRACE:
- systracetrans(kf);
+ if (checkfile == 0)
+ systracetrans(kf);
break;
default:
if (vflg) {