Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jun 1999 10:35:06 +0800 (KRSS)
From:      tolik@mpeks.tomsk.su
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/12000: Problem with lsvfs
Message-ID:  <199906030235.KAA04057@www1.tomsk.su>

index | next in thread | raw e-mail


>Number:         12000
>Category:       bin
>Synopsis:       lsvfs with vfsname args returned wrong data
>Confidential:   yes
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun  2 19:40:00 PDT 1999
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199906030235.KAA04057>