From seggers@semyam.dinoco.de  Mon May 25 13:43:34 1998
Received: from tim.xenologics.com (tim.xenologics.com [194.77.5.24])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA01504
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 25 May 1998 13:43:31 -0700 (PDT)
          (envelope-from seggers@semyam.dinoco.de)
Received: (from uucp@localhost)
	by tim.xenologics.com (8.8.5/8.8.8) with UUCP id WAA17006
	for FreeBSD-gnats-submit@freebsd.org; Mon, 25 May 1998 22:37:06 +0200 (MET DST)
Received: (from seggers@localhost)
	by semyam.dinoco.de (8.8.8/8.8.8) id WAA05584;
	Mon, 25 May 1998 22:35:58 +0200 (CEST)
	(envelope-from seggers)
Message-Id: <199805252035.WAA05584@semyam.dinoco.de>
Date: Mon, 25 May 1998 22:35:58 +0200 (CEST)
From: Stefan Eggers <seggers@semyam.dinoco.de>
Reply-To: seggers@semyam.dinoco.de
To: FreeBSD-gnats-submit@freebsd.org
Cc: seggers@semyam.dinoco.de
Subject: getvfsent(3) example is out of date
X-Send-Pr-Version: 3.2

>Number:         6753
>Category:       docs
>Synopsis:       getvfsent(3) example is out of date
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 25 13:40:00 PDT 1998
>Closed-Date:    Mon May 25 14:37:01 PDT 1998
>Last-Modified:  Mon May 25 14:39:33 PDT 1998
>Originator:     Stefan Eggers
>Release:        FreeBSD 2.2.6-STABLE i386
>Organization:
none
>Environment:

>Description:

	The example used in the man page to getvfsent(3) is taken from
the source of mount_cd9660(8).  Unfortunately this source changed a
bit since the inclusion so this example is a bit out of date.

	There is also a mentioning about the odd conditional
expression in the mount call below the example.  As the new code works
w/o this it is not applicable and should get removed.

>How-To-Repeat:

	Just read the example in the man page of getvfsent(3) and the
source of mount_cd9660(8) and compare the corresponding parts.

>Fix:
	
	I fixed this problem by just copying over the new code and
changing the formatting a bit so that the indention style is unchanged
from the old example.

	The above mentioned obsolete paragraph about the condicitional
expression I just removed as it is not applicable anymore.

*** getvfsent.3.ORIG	Fri Feb 28 06:49:18 1997
--- getvfsent.3	Mon May 25 22:09:55 1998
***************
*** 140,160 ****
  
  vfc = getvfsbyname("cd9660");
  if(!vfc && vfsisloadable("cd9660")) {
! 	if(vfsload("cd9660"))
! 		err(1, "vfsload(cd9660)");
! 	endvfsent();	/* flush cache */
  	vfc = getvfsbyname("cd9660");
  }
  
! mount(vfc ? vfc->vfc_index : MOUNT_CD9660, /* more arguments */
  
- .Ed
- The odd conditional in the call to
- .Xr mount 2
- is present for compatibility with old, non-LKM cognizant kernels, and
- will be removed (along with all vestiges of
- .Dv MOUNT_* )
- in a future release.
  .Sh RETURN VALUES
  The
  .Fn getvfsbyname ,
--- 140,157 ----
  
  vfc = getvfsbyname("cd9660");
  if(!vfc && vfsisloadable("cd9660")) {
! 	if(vfsload("cd9660")) {
! 		err(EX_OSERR, "vfsload(cd9660)");
! 	}
! 	endvfsent();    /* flush cache */
  	vfc = getvfsbyname("cd9660");
  }
+ if (!vfc)
+ 	errx(EX_OSERR, "cd9660 filesystem not available");
  
! if (mount(vfc->vfc_index, dir, mntflags, &args) < 0)
! 	err(EX_OSERR, "%s", dev);
  
  .Sh RETURN VALUES
  The
  .Fn getvfsbyname ,
>Release-Note:
>Audit-Trail:

From: Stefan Eggers <seggers@semyam.dinoco.de>
To: FreeBSD-gnats-submit@FreeBSD.ORG, doc@FreeBSD.ORG
Cc: seggers@semyam.dinoco.de
Subject: Re: docs/6753: getvfsent(3) example is out of date 
Date: Mon, 25 May 1998 22:47:33 +0200

 Sorry!  I killed one line too much.  :-(  Here is the - hopefully
 now correct - diff output:
 
 *** getvfsent.3.ORIG	Fri Feb 28 06:49:18 1997
 --- getvfsent.3	Mon May 25 22:39:13 1998
 ***************
 *** 140,160 ****
   
   vfc = getvfsbyname("cd9660");
   if(!vfc && vfsisloadable("cd9660")) {
 ! 	if(vfsload("cd9660"))
 ! 		err(1, "vfsload(cd9660)");
 ! 	endvfsent();	/* flush cache */
   	vfc = getvfsbyname("cd9660");
   }
   
 ! mount(vfc ? vfc->vfc_index : MOUNT_CD9660, /* more arguments */
   
   .Ed
 - The odd conditional in the call to
 - .Xr mount 2
 - is present for compatibility with old, non-LKM cognizant kernels, and
 - will be removed (along with all vestiges of
 - .Dv MOUNT_* )
 - in a future release.
   .Sh RETURN VALUES
   The
   .Fn getvfsbyname ,
 --- 140,158 ----
   
   vfc = getvfsbyname("cd9660");
   if(!vfc && vfsisloadable("cd9660")) {
 ! 	if(vfsload("cd9660")) {
 ! 		err(EX_OSERR, "vfsload(cd9660)");
 ! 	}
 ! 	endvfsent();    /* flush cache */
   	vfc = getvfsbyname("cd9660");
   }
 + if (!vfc)
 + 	errx(EX_OSERR, "cd9660 filesystem not available");
   
 ! if (mount(vfc->vfc_index, dir, mntflags, &args) < 0)
 ! 	err(EX_OSERR, "%s", dev);
   
   .Ed
   .Sh RETURN VALUES
   The
   .Fn getvfsbyname ,
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Mon May 25 14:37:01 PDT 1998 
State-Changed-Why:  
Patch committed to -stable, thanks!  I'm working on a similar 
patch for -current since it suffers from the same ailment. 
>Unformatted:
