summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-06-17 02:21:54 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-06-17 02:21:54 +0000
commit5d5492fc4cac76b341896a03ed2a199a6a2ab397 (patch)
treecbd4cc544730b15634a4474ed7d4cf66aff7c400
parent37bebbf64b99fb617a4327917a16593a786684f0 (diff)
The eject half of mt requires a device, instead of defaulting to the tape.
-rw-r--r--bin/mt/mt.14
-rw-r--r--bin/mt/mt.c15
2 files changed, 12 insertions, 7 deletions
diff --git a/bin/mt/mt.1 b/bin/mt/mt.1
index 645886d893a..ef22cbd3c5e 100644
--- a/bin/mt/mt.1
+++ b/bin/mt/mt.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: mt.1,v 1.5 1996/06/12 07:50:57 downsj Exp $
+.\" $OpenBSD: mt.1,v 1.6 1996/06/17 02:21:50 downsj Exp $
.\" $NetBSD: mt.1,v 1.8 1996/05/21 10:23:55 mrg Exp $
.\"
.\" Copyright (c) 1981, 1990, 1993
@@ -48,7 +48,7 @@
.Op Ar count
.Nm eject
.Op Fl f
-.Op Ar tapename
+.Ar tapename
.Sh DESCRIPTION
.Nm Mt
is used to give commands to a magnetic tape drive.
diff --git a/bin/mt/mt.c b/bin/mt/mt.c
index 0e4e0768897..1497773a75b 100644
--- a/bin/mt/mt.c
+++ b/bin/mt/mt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mt.c,v 1.7 1996/06/12 07:58:41 downsj Exp $ */
+/* $OpenBSD: mt.c,v 1.8 1996/06/17 02:21:53 downsj Exp $ */
/* $NetBSD: mt.c,v 1.14.2.1 1996/05/27 15:12:11 mrg Exp $ */
/*
@@ -126,11 +126,13 @@ main(argc, argv)
else
progname = argv[0];
- if (strcmp(progname, "eject") == 0)
+ if (strcmp(progname, "eject") == 0) {
eject = 1;
-
- if ((tape = getenv("TAPE")) == NULL)
- tape = DEFTAPE;
+ tape = NULL;
+ } else {
+ if ((tape = getenv("TAPE")) == NULL)
+ tape = DEFTAPE;
+ }
while ((ch = getopt(argc, argv, "f:t:")) != -1) {
switch (ch) {
@@ -157,6 +159,9 @@ main(argc, argv)
} else if (argc < 1 || argc > 2)
usage();
+ if (tape == NULL)
+ usage();
+
if (strchr(tape, ':')) {
host = tape;
tape = strchr(host, ':');