Date: 17 Apr 2001 07:42:03 -0000 From: Peter Pentchev <roam@orbitel.bg> To: FreeBSD-gnats-submit@freebsd.org Subject: bin/26637: [PATCH] fstat does not recognize FIFO's Message-ID: <20010417074203.4799.qmail@ringworld.nanolink.com>
next in thread | raw e-mail | index | archive | help
>Number: 26637
>Category: bin
>Synopsis: [PATCH] fstat does not recognize FIFO's
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Apr 17 00:50:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Peter Pentchev
>Release: FreeBSD 4.3-RC i386
>Organization:
Orbitel JSCo.
>Environment:
System: FreeBSD ringworld.oblivion.bg 4.3-RC #50: Sun Apr 15 21:11:57 EEST
>Description:
/usr/bin/fstat does not recognize DTYPE_FIFO, and either ignores such fd's,
or, if invoked with '-v', complains about unknown file types.
>How-To-Repeat:
Plain vanilla 4.3-RC /usr/bin/fstat..
[root@ringworld:v0]# fstat -v 2>&1 | awk '($7=="6" && $10=="368") {print}'
unknown file type 4 for file 6 of pid 368
After applying the attached patch..
[root@ringworld:v0]# ./fstat -v 2>&1 | awk '($3=="368") && ($4=="6") {print}'
root supervise 368 6 /usr 583875 prw------- 0 r
>Fix:
Against -current, applies with a negligible offset to -stable..
Index: src/usr.bin/fstat/fstat.c
===================================================================
RCS file: /home/ncvs/src/usr.bin/fstat/fstat.c,v
retrieving revision 1.26
diff -u -r1.26 fstat.c
--- src/usr.bin/fstat/fstat.c 2001/02/15 22:42:44 1.26
+++ src/usr.bin/fstat/fstat.c 2001/04/17 07:23:05
@@ -365,6 +365,13 @@
file.f_flag);
}
#endif
+#ifdef DTYPE_FIFO
+ else if (file.f_type == DTYPE_FIFO) {
+ if (checkfile == 0)
+ vtrans((struct vnode *)file.f_data, i,
+ file.f_flag);
+ }
+#endif
else {
dprintf(stderr,
"unknown file type %d for file %d of pid %d\n",
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010417074203.4799.qmail>
