summaryrefslogtreecommitdiffstats
path: root/sbin/fsdb
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>1997-06-11 07:13:30 +0000
committercharnier <charnier@FreeBSD.org>1997-06-11 07:13:30 +0000
commit128554a0bd59c6c97e53c6cec3cc4d3baa223fcd (patch)
treead0ee92c68019e367c0fc53406c1a648a149e94f /sbin/fsdb
parent5d18065463d00e184ff9bd1aaa17936d5da8ca32 (diff)
downloadFreeBSD-src-128554a0bd59c6c97e53c6cec3cc4d3baa223fcd.zip
FreeBSD-src-128554a0bd59c6c97e53c6cec3cc4d3baa223fcd.tar.gz
Remove __progname. Make -f a no-op flag as stated in the man page. Remove
unused variables.
Diffstat (limited to 'sbin/fsdb')
-rw-r--r--sbin/fsdb/fsdb.c37
1 files changed, 17 insertions, 20 deletions
diff --git a/sbin/fsdb/fsdb.c b/sbin/fsdb/fsdb.c
index 1a80e28..7ab1e05 100644
--- a/sbin/fsdb/fsdb.c
+++ b/sbin/fsdb/fsdb.c
@@ -26,10 +26,12 @@
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $Id$
*/
#ifndef lint
-static char rcsid[] = "$Id: fsdb.c,v 1.7 1997/03/13 12:44:51 peter Exp $";
+static char rcsid[] = "$Id: fsdb.c,v 1.8 1997/04/15 09:02:45 joerg Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -47,6 +49,7 @@ static char rcsid[] = "$Id: fsdb.c,v 1.7 1997/03/13 12:44:51 peter Exp $";
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <err.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ufs/dir.h>
@@ -55,15 +58,14 @@ static char rcsid[] = "$Id: fsdb.c,v 1.7 1997/03/13 12:44:51 peter Exp $";
#include "fsdb.h"
#include "fsck.h"
-extern char *__progname; /* from crt0.o */
-
-void usage __P((void));
+static void usage __P((void));
int cmdloop __P((void));
-void
+static void
usage()
{
- errx(1, "usage: %s [-d] [-r] -f <fsname>", __progname);
+ fprintf(stderr, "usage: fsdb [-d] [-f] [-r] fsname\n");
+ exit(1);
}
int returntosingle = 0;
@@ -82,12 +84,13 @@ main(argc, argv)
{
int ch, rval;
char *fsys = NULL;
- struct stat stb;
- while (-1 != (ch = getopt(argc, argv, "f:dr"))) {
+ while (-1 != (ch = getopt(argc, argv, "fdr"))) {
switch (ch) {
case 'f':
- fsys = optarg;
+ /* The -f option is left for historical
+ * reasons and has no meaning.
+ */
break;
case 'd':
debug++;
@@ -101,12 +104,10 @@ main(argc, argv)
}
argc -= optind;
argv += optind;
- if (fsys == NULL) {
- if (argc != 1)
- usage();
- else
- fsys = argv[0];
- }
+ if (argc != 1)
+ usage();
+ else
+ fsys = argv[0];
if (!setup(fsys))
errx(1, "cannot set up file system `%s'", fsys);
@@ -235,7 +236,7 @@ cmdloop()
hist = history_init();
history(hist, H_EVENT, 100); /* 100 elt history buffer */
- elptr = el_init(__progname, stdin, stdout);
+ elptr = el_init("fsdb", stdin, stdout);
el_set(elptr, EL_EDITOR, "emacs");
el_set(elptr, EL_PROMPT, prompt);
el_set(elptr, EL_HIST, history, hist);
@@ -473,7 +474,6 @@ CMDFUNCSTART(focusname)
CMDFUNCSTART(ln)
{
ino_t inum;
- struct dinode *dp;
int rval;
char *cp;
@@ -523,7 +523,6 @@ chinumfunc(idesc)
CMDFUNCSTART(chinum)
{
- int rval;
char *cp;
ino_t inum;
struct inodesc idesc;
@@ -577,7 +576,6 @@ CMDFUNCSTART(chname)
{
int rval;
char *cp;
- ino_t inum;
struct inodesc idesc;
slotcount = 0;
@@ -620,7 +618,6 @@ struct typemap {
CMDFUNCSTART(newtype)
{
- int rval = 1;
int type;
struct typemap *tp;
OpenPOWER on IntegriCloud