From roam@orbitel.bg Tue Apr 17 00:43:39 2001 Return-Path: Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id 03AE637B42C for ; Tue, 17 Apr 2001 00:43:34 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 4800 invoked by uid 1000); 17 Apr 2001 07:42:03 -0000 Message-Id: <20010417074203.4799.qmail@ringworld.nanolink.com> Date: 17 Apr 2001 07:42:03 -0000 From: Peter Pentchev Reply-To: Peter Pentchev To: FreeBSD-gnats-submit@freebsd.org Cc: Subject: [PATCH] fstat does not recognize FIFO's X-Send-Pr-Version: 3.113 X-GNATS-Notify: >Number: 26637 >Category: bin >Synopsis: [PATCH] fstat does not recognize FIFO's >Confidential: no >Severity: non-critical >Priority: low >Responsible: roam >State: closed >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Apr 17 00:50:01 PDT 2001 >Closed-Date: Mon Jul 23 00:24:03 PDT 2001 >Last-Modified: Mon Jul 23 00:24:27 PDT 2001 >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: Responsible-Changed-From-To: freebsd-bugs->roam Responsible-Changed-By: dd Responsible-Changed-When: Mon Jun 18 18:24:53 PDT 2001 Responsible-Changed-Why: Originator's MFC reminder. http://www.FreeBSD.org/cgi/query-pr.cgi?pr=26637 State-Changed-From-To: open->closed State-Changed-By: roam State-Changed-When: Mon Jul 23 00:24:03 PDT 2001 State-Changed-Why: Committed to -current 5 weeks ago, MFC'd now. http://www.FreeBSD.org/cgi/query-pr.cgi?pr=26637 >Unformatted: