Commit Graph

44 Commits

Author SHA1 Message Date
des
d38c9ef674 Restore the -c option, which was accidentally removed from the getopt
string two revisions ago.
2001-03-06 01:58:30 +00:00
des
e5e0087f91 Document the new -k option in usage message and man page. 2001-02-16 16:28:36 +00:00
des
e7c92315f1 Add a -k option that prevents clearing the dump after saving it.
Use sysctlbyname() instead of sysctl().

Clear up and simplify the version extraction code.

Attempt to detect stretches of zeroes in the dump and avoid writing
them to disk to save space and time.
2001-02-16 16:27:32 +00:00
ru
04d60c1164 Prepare for mdoc(7)NG. 2001-01-16 09:15:57 +00:00
ru
ea31070695 mdoc(7) police: use the new features of the Nm macro. 2000-11-20 16:52:27 +00:00
des
8006e3e8c7 Work much harder at obtaining a correct device node. If what devname(3)
returns doesn't exist, or doesn't match the desired device, fall back to
scanning /dev for a matching node, and as a last resort, if that fails,
try to create the node ourselves as /dev/dump.

Add comments to several variables and functions.

Clean up syslog(3) usage; use %m instead of strerror(3).

Other minor cleanup.
2000-10-17 22:43:41 +00:00
des
9cd7f92a88 Remove superfluous code:
1) use devname() instead of searching /dev for the dump device

   2) use fopen() instead of open() so we don't need to differentiate
      between compressing and not compressing when writing the core
      file or the kernel (zopen() returns a FILE *, so we just use
      fwrite() in both cases)

There should be no functional changes.
2000-09-28 20:09:36 +00:00
peter
1c39180518 I'm not sure what changed to cause this, but using 'dirname' as a variable
was colliding with dirname() in libc.a and causing a Sig 10/bus error.
Just change dirname to savedir and be done with it.
2000-09-03 07:02:00 +00:00
ps
dc13001fde Tidy up the offset calculations.
Submitted by:	bde
2000-05-09 22:20:14 +00:00
ps
3cad7070e8 Read the correct size into kdumplo.
Botched/Noticed by:	peter
2000-05-09 01:08:00 +00:00
ps
f0dd8b6679 Allow savecore to work on > 2GB partitions.
Submitted by:	peter
2000-05-08 22:57:35 +00:00
bde
0465507783 Fixed style bugs in rev.1.28. Rev.1.28 was not submitted by bde. 2000-03-20 20:07:28 +00:00
ps
7b653e3781 Only character devices exsist these days. Make savecore understand
this.
2000-03-20 06:54:06 +00:00
obrien
a47dd1c1e2 Fix bogus initialization of using a sledge hammer to quite -Wall, bad
indention, and size issue between 32 and 64bit machines.

Submitted by:	bde
1999-12-21 07:41:07 +00:00
obrien
206faac867 When erroring out that there is not enough space to write the corefile,
tell the user how much space is avaible for writing the corefile, and how
much space we wanted.
1999-12-08 06:22:58 +00:00
ache
beffd26bc8 Allow character devices too 1999-11-30 03:48:04 +00:00
phk
34b4a59103 Fix savecore so that it operates correctly on character devices with
sectorsizes up to 8k.

Pointed out by: sos
1999-08-31 18:12:44 +00:00
peter
76f0c923fe $Id$ -> $FreeBSD$ 1999-08-28 00:22:10 +00:00
luoqi
a6a19d8e19 Read dumpdev using sysctl(3) interface. Now savecore should work again
after the dev_t changes.
1999-05-13 04:29:09 +00:00
gallatin
8963bb48a7 Fix savecore so that it works on alphas
Reviewed by: Doug Rabson <dfr@nlsystems.com>
1999-03-12 14:46:00 +00:00
charnier
b2d8598d95 Correct use of .Nm, add rcsid, remove unused #include. 1998-07-28 06:38:57 +00:00
bde
21b894709f Fixed printf format errors. 1998-06-28 20:33:36 +00:00
phk
1e95007485 Pickup _time_second instead of _time 1998-03-30 10:10:29 +00:00
imp
167db52912 compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.
1997-03-29 03:33:12 +00:00
peter
4968036f61 Revert $FreeBSD$ to $Id$ 1997-02-22 14:40:44 +00:00
jkh
808a36ef65 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
joerg
f685f88823 Fix my yesterday's brain-o: don't account for the kilobytes twice. 1996-10-14 22:56:01 +00:00
joerg
14dd70138e Yikes! Originally, i intended to apply the patch from PR # 1322,
but Bill has beaten me on this. ;-)

However, he missed the part to compute the kernelsize in kilobytes,
so the minfree consideration was now overcautious.  (I've also
changed the return type of dump_size() to void since int was useless.)

Being here, the fact that `vmcore' was written world-readable was just
a plain security hole: everybody who was able to crash a kernel could
later read any confidential information out of it at his will.  Create
it with umask 077 instead.
1996-10-13 20:55:45 +00:00
fenner
c4eeb055c1 Make the savecore command work like the man page says:
- make minfree work by getting the dump size before checking to see
  if the dump will fit on the filesystem
- also fail to dump if no minfree is specified but there are not enough
  free blocks.

Fix a typo in the man page.

Fixes PR bin/1322

Submitted by:	"Philippe C." <charnier@lirmm.fr>
1996-10-13 18:12:20 +00:00
dg
a078f218b5 Cast the partial result of an expression to an off_t to fix an overflow
in the calculation of free disk space. Fixes PR#1569.

Submitted by:	Tor Egge <Tor.Egge@idt.ntnu.no>
1996-09-05 08:08:41 +00:00
wosch
b72054ac4e a header file for zopen.3
Pointed out by: Philippe Charnier <charnier@lirmm.fr>
1996-08-20 20:49:39 +00:00
phk
8b3eb1da82 NBPG -> getpagesize() 1996-05-02 09:09:04 +00:00
peter
e93aa4ed1d Add #include <vm/pmap.h> in order to make savecore compile again after the
last round of <vm/*.h> include file changes.
1995-12-13 11:36:20 +00:00
wollman
fc1f6c1d76 Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.
1995-08-07 19:17:46 +00:00
joerg
5cdb5f24d2 Remove a newline from the output of savecore(8), so the bogus number
1024 that used to remain on a line of its own after savecore completed
its job will be overwritten later in the /etc/rc process.

Reviewed by:
Submitted by:	graichen@sirius.physik.fu-berlin.de (Thomas Graichen)
Obtained from:
1995-07-30 13:10:56 +00:00
bde
c2f0020e47 Remove a bogus fclose. Normally the "w" stream for /var/crash/bounds was
fclosed twice and this didn't seem to cause any problems, but when
/var/crash was on an an unwritable nfs-mounted partition, fclose(NULL)
caused a core dump.
1995-07-11 17:03:44 +00:00
rgrimes
f3a2b348da Remove trailing whitespace. 1995-05-30 06:12:45 +00:00
joerg
d6efd109b7 The -N option takes one argument, hence the getopt control string
needs to have a colon for it.  Looks like nobody has tested this
so far.
1995-01-02 12:08:06 +00:00
wollman
193a8fae68 Get rid of _PATH_UNIX completely; use getbootfile(3) instead.
DANGER WILL ROBINSON!
_PATH_UNIX is currently defined as the literal string "don't use this".
I am of two minds about this myself, but wanted to get something into the
tree as quickly as possible.
1994-09-24 00:08:43 +00:00
dg
6b466831f4 Converted 'vmunix' to 'kernel'. 1994-08-05 09:14:37 +00:00
wollman
57ea13e98c Convert to our man installation style. Also fixed long-standing bug
in `fastboot'/`fasthalt' in which the interpreter would hang around
after `reboot' or `halt' is run, causing an irritating ``Killed'' message.
1994-08-05 02:42:42 +00:00
rgrimes
eb95a6d0ed I know better than to edit files on freefall, next time take a patch file.
Change vm_paramh. to vm_param.h
1994-05-28 16:21:59 +00:00
rgrimes
f2fe00c5a1 Must now include vm/vm.h and vm/vm_param.h due to the way we define KERNBASE.
Reviewed by:	David Greenman
1994-05-28 04:15:16 +00:00
rgrimes
d038e02fd6 BSD 4.4 Lite sbin Sources
Note:  XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.
1994-05-26 06:35:07 +00:00