Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Dec 2012 15:12:09 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r244218 - in head: etc/rc.d sbin/savecore
Message-ID:  <201212141512.qBEFC9Ck084515@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Fri Dec 14 15:12:08 2012
New Revision: 244218
URL: http://svnweb.freebsd.org/changeset/base/244218

Log:
  - When checking if a dump exists on the given device there is no need to
    provide dump directory. Eliminate this redundant argument. This changes
    the usage, but the only risk here is that a warning will be printed
    about directory given as device.
  
  - Update usage of -C option.
  
  - When clearing dump header from the given device there is also no need to
    provide dump directory, although additional arguments for -c were not
    documented.
  
  - Document that -v can be used with -c and that list of devices can be given.
  
  Obtained from:	WHEEL Systems

Modified:
  head/etc/rc.d/savecore
  head/sbin/savecore/savecore.8
  head/sbin/savecore/savecore.c

Modified: head/etc/rc.d/savecore
==============================================================================
--- head/etc/rc.d/savecore	Fri Dec 14 15:04:39 2012	(r244217)
+++ head/etc/rc.d/savecore	Fri Dec 14 15:12:08 2012	(r244218)
@@ -62,7 +62,7 @@ savecore_start()
 		;;
 	esac
 
-	if savecore -C "${dumpdir}" "${dev}" >/dev/null; then
+	if savecore -C "${dev}" >/dev/null; then
 		savecore ${savecore_flags} ${dumpdir} ${dumpdev}
 		if checkyesno crashinfo_enable; then
 			${crashinfo_program} -d ${dumpdir}

Modified: head/sbin/savecore/savecore.8
==============================================================================
--- head/sbin/savecore/savecore.8	Fri Dec 14 15:04:39 2012	(r244217)
+++ head/sbin/savecore/savecore.8	Fri Dec 14 15:12:08 2012	(r244218)
@@ -28,7 +28,7 @@
 .\"     From: @(#)savecore.8	8.1 (Berkeley) 6/5/93
 .\" $FreeBSD$
 .\"
-.Dd December 24, 2008
+.Dd December 14, 2012
 .Dt SAVECORE 8
 .Os
 .Sh NAME
@@ -37,10 +37,12 @@
 .Sh SYNOPSIS
 .Nm
 .Fl c
+.Op Fl v
+.Op Ar device ...
 .Nm
 .Fl C
 .Op Fl v
-.Op Ar directory device
+.Op Ar device ...
 .Nm
 .Op Fl fkvz
 .Op Ar directory Op Ar device ...

Modified: head/sbin/savecore/savecore.c
==============================================================================
--- head/sbin/savecore/savecore.c	Fri Dec 14 15:04:39 2012	(r244217)
+++ head/sbin/savecore/savecore.c	Fri Dec 14 15:12:08 2012	(r244218)
@@ -636,8 +636,8 @@ static void
 usage(void)
 {
 	fprintf(stderr, "%s\n%s\n%s\n",
-	    "usage: savecore -c",
-	    "       savecore -C [-v] [directory device]",
+	    "usage: savecore -c [-v] [device ...]",
+	    "       savecore -C [-v] [device ...]",
 	    "       savecore [-fkvz] [directory [device ...]]");
 	exit (1);
 }
@@ -685,7 +685,7 @@ main(int argc, char **argv)
 		usage();
 	argc -= optind;
 	argv += optind;
-	if (argc >= 1) {
+	if (argc >= 1 && !checkfor && !clear) {
 		error = chdir(argv[0]);
 		if (error) {
 			syslog(LOG_ERR, "chdir(%s): %m", argv[0]);



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