summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-12-22 17:23:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-12-22 17:23:28 +0000
commitbe89460d50864c01477513d9bb0f53a6884e4a46 (patch)
tree1ee75225ef0a484079890860de5ebac65719c2b7
parent46bf6e957f3fbd4ffcde1a67ae1da0dc78048371 (diff)
if in eject mode, do not include command name in error output; bug spotted by drahn
-rw-r--r--bin/mt/mt.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/mt/mt.c b/bin/mt/mt.c
index 16b1bd49c84..cabe1ed5ebb 100644
--- a/bin/mt/mt.c
+++ b/bin/mt/mt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mt.c,v 1.25 2005/05/01 18:56:36 deraadt Exp $ */
+/* $OpenBSD: mt.c,v 1.26 2005/12/22 17:23:27 deraadt Exp $ */
/* $NetBSD: mt.c,v 1.14.2.1 1996/05/27 15:12:11 mrg Exp $ */
/*
@@ -40,7 +40,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mt.c 8.2 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: mt.c,v 1.25 2005/05/01 18:56:36 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: mt.c,v 1.26 2005/12/22 17:23:27 deraadt Exp $";
#endif
#endif /* not lint */
@@ -194,8 +194,12 @@ main(int argc, char *argv[])
else
mt_com.mt_count = 1;
if ((host ? rmtioctl(mt_com.mt_op, mt_com.mt_count) :
- ioctl(mtfd, MTIOCTOP, &mt_com)) < 0)
- err(2, "%s: %s", tape, comp->c_name);
+ ioctl(mtfd, MTIOCTOP, &mt_com)) < 0) {
+ if (eject)
+ err(2, "%s", tape);
+ else
+ err(2, "%s: %s", tape, comp->c_name);
+ }
} else {
if (host)
status(rmtstatus());