From tolik@www1.tomsk.su Wed Jun  2 19:36:25 1999
Return-Path: <tolik@www1.tomsk.su>
Received: from www1.tomsk.su (www1.tomsk.su [212.176.23.6])
	by hub.freebsd.org (Postfix) with ESMTP id D47F31505E
	for <FreeBSD-gnats-submit@freebsd.org>; Wed,  2 Jun 1999 19:35:28 -0700 (PDT)
	(envelope-from tolik@www1.tomsk.su)
Received: (from tolik@localhost)
	by www1.tomsk.su (8.9.2/8.9.2) id KAA04057;
	Thu, 3 Jun 1999 10:35:06 +0800 (KRSS)
	(envelope-from tolik)
Message-Id: <199906030235.KAA04057@www1.tomsk.su>
Date: Thu, 3 Jun 1999 10:35:06 +0800 (KRSS)
From: tolik@mpeks.tomsk.su
Sender: tolik@www1.tomsk.su
Reply-To: tolik@mpeks.tomsk.su
To: FreeBSD-gnats-submit@freebsd.org
Subject: Problem with lsvfs
X-Send-Pr-Version: 3.2

>Number:         12000
>Category:       bin
>Synopsis:       lsvfs with vfsname args returned wrong data
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun  2 19:40:00 PDT 1999
>Closed-Date:    Thu Jun 3 02:12:31 PDT 1999
>Last-Modified:  Tue Nov 27 18:30:34 PST 2001
>Originator:     Anatoly A. Orehovsky
>Release:        FreeBSD 3.1-RELEASE i386
>Organization:
SibPTUS
>Environment:


>Description:

lsvfs with vfsname args returned wrong data. Also lsvfs not returned "Index" field as was before.

>How-To-Repeat:

lsvfs ufs procfs

>Fix:

This patch corrected this problem and added "Index" field in lsvfs output:

*** lsvfs.c.orig	Thu Jun  3 10:11:22 1999
--- lsvfs.c	Thu Jun  3 10:17:22 1999
***************
*** 15,23 ****
  #include <stdio.h>
  #include <string.h>
  
! #define FMT "%-32.32s %5d %s\n"
! #define HDRFMT "%-32.32s %5.5s %s\n"
! #define DASHES "-------------------------------- ----- ---------------\n"
  
  static const char *fmt_flags(int);
  
--- 15,23 ----
  #include <stdio.h>
  #include <string.h>
  
! #define FMT "%-32.32s %5d %5d %s\n"
! #define HDRFMT "%-32.32s %5.5s %5.5s %s\n"
! #define DASHES "-------------------------------- ----- ----- ---------------\n"
  
  static const char *fmt_flags(int);
  
***************
*** 31,43 ****
  
    setvfsent(1);
  
!   printf(HDRFMT, "Filesystem", "Refs", "Flags");
    fputs(DASHES, stdout);
  
    if(argc) {
      for(; argc; argc--, argv++) {
!       if (getvfsbyname(*argv, &vfc) != 0) {
!         printf(FMT, vfc.vfc_name, vfc.vfc_refcount, fmt_flags(vfc.vfc_flags));
        } else {
  	warnx("VFS %s unknown or not loaded", *argv);
          rv++;
--- 31,43 ----
  
    setvfsent(1);
  
!   printf(HDRFMT, "Filesystem", "Index", "Refs", "Flags");
    fputs(DASHES, stdout);
  
    if(argc) {
      for(; argc; argc--, argv++) {
!       if (getvfsbyname(*argv, &vfc) == 0) {
!         printf(FMT, vfc.vfc_name, vfc.vfc_typenum, vfc.vfc_refcount, fmt_flags(vfc.vfc_flags));
        } else {
  	warnx("VFS %s unknown or not loaded", *argv);
          rv++;
***************
*** 45,51 ****
      }
    } else {
      while (ovfcp = getvfsent()) {
!       printf(FMT, ovfcp->vfc_name, ovfcp->vfc_refcount,
               fmt_flags(ovfcp->vfc_flags));
      }
    }
--- 45,51 ----
      }
    } else {
      while (ovfcp = getvfsent()) {
!       printf(FMT, ovfcp->vfc_name, ovfcp->vfc_index, ovfcp->vfc_refcount,
               fmt_flags(ovfcp->vfc_flags));
      }
    }

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ru 
State-Changed-When: Thu Jun 3 02:12:31 PDT 1999 
State-Changed-Why:  
Fixed in -current and -stable, thanks! 
"Index" is considered anachronism. 
>Unformatted:
