Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Dec 1999 04:43:05 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Thomas Stromberg <tstromberg@rtci.com>
Cc:        "Andrey A. Chernov" <ache@FreeBSD.ORG>, freebsd-current@FreeBSD.ORG
Subject:   Re: semi-HEADS-UP (dumpon now wants raw disk device)
Message-ID:  <Pine.BSF.4.10.9912010432250.15654-100000@alphplex.bde.org>
In-Reply-To: <3843F225.34D5E976@rtci.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 30 Nov 1999, Thomas Stromberg wrote:

[ache wrote]:
> "
> > I see no needs of this change. I have -current dumpon/savecore work with
> > old entrly like /dev/wd0...
> > savecore understand both character and old block devices now.

You must not have a very current -current :-).  /dev/wd0 is a character
device (with the same major/minor and character as /dev/rwd0) in -current:

crw-r-----  1 root  operator    3, 0x00010002 Dec  1 04:34 rwd0
crw-r-----  1 root  operator    3, 0x00010002 Dec  1 04:34 wd0

> [root@karma] dumpon> grep \$FreeBSD dumpon.c
>   "$FreeBSD: src/sbin/dumpon/dumpon.c,v 1.8 1999/11/28 16:24:46 phk Exp
> $";
> [root@karma] dumpon> dumpon /dev/wd0s1b
> dumpon: /dev/wd0s1b: must specify a block device
> [root@karma] dumpon> dumpon /dev/rwd0s1b
> [root@karma] dumpon> 
> 
> Bug or Feature? 

Bug in dumpon.  The error message no longer matches the code.  I use the
following "fix".  I changed the code too.  dumpon(8) shouldn't be checking
whether the file supports the dumpon sysctl.  All it needs is a valid
st_rdev to pass to the dumpon sysctl.

diff -c2 dumpon.c~ dumpon.c
*** dumpon.c~	Mon Nov 29 20:09:29 1999
--- dumpon.c	Mon Nov 29 20:16:40 1999
***************
*** 85,91 ****
  		}
  
! 		if (!S_ISCHR(stab.st_mode)) {
! 			errx(EX_USAGE, "%s: must specify a block device",
! 			     argv[0]);
  		}
  	} else {
--- 85,90 ----
  		}
  
! 		if (!S_ISBLK(stab.st_mode) && !S_ISCHR(stab.st_mode)) {
! 			errx(EX_USAGE, "%s: must specify a device", argv[0]);
  		}
  	} else {

Bruce



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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.10.9912010432250.15654-100000>