Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sbin/dump Pull up revision 1.24 (requested by tron):



details:   https://anonhg.NetBSD.org/src/rev/5bc6e3d45de6
branches:  netbsd-1-5
changeset: 491692:5bc6e3d45de6
user:      he <he%NetBSD.org@localhost>
date:      Wed May 09 19:16:07 2001 +0000

description:
Pull up revision 1.24 (requested by tron):
  Add a new option ``e'' to dump which directs it to eject tapes
  automatically if a tape change is required.

diffstat:

 sbin/dump/dump.h |   3 ++-
 sbin/dump/tape.c |  14 ++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diffs (59 lines):

diff -r 58630a8f94b4 -r 5bc6e3d45de6 sbin/dump/dump.h
--- a/sbin/dump/dump.h  Wed May 09 00:10:55 2001 +0000
+++ b/sbin/dump/dump.h  Wed May 09 19:16:07 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dump.h,v 1.19.6.1 2000/10/18 00:39:43 tv Exp $ */
+/*     $NetBSD: dump.h,v 1.19.6.2 2001/05/09 19:16:07 he Exp $ */
 
 /*-
  * Copyright (c) 1980, 1993
@@ -97,6 +97,7 @@
 char   lastlevel;      /* dump level of previous dump */
 char   level;          /* dump level of this dump */
 int    uflag;          /* update flag */
+int    eflag;          /* eject flag */
 int    diskfd;         /* disk file descriptor */
 int    tapefd;         /* tape file descriptor */
 int    pipeout;        /* true => output to standard output */
diff -r 58630a8f94b4 -r 5bc6e3d45de6 sbin/dump/tape.c
--- a/sbin/dump/tape.c  Wed May 09 00:10:55 2001 +0000
+++ b/sbin/dump/tape.c  Wed May 09 19:16:07 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tape.c,v 1.21.6.1 2000/10/17 21:49:33 tv Exp $ */
+/*     $NetBSD: tape.c,v 1.21.6.2 2001/05/09 19:16:07 he Exp $ */
 
 /*-
  * Copyright (c) 1980, 1991, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)tape.c     8.4 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: tape.c,v 1.21.6.1 2000/10/17 21:49:33 tv Exp $");
+__RCSID("$NetBSD: tape.c,v 1.21.6.2 2001/05/09 19:16:07 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -54,6 +54,8 @@
 #else
 #include <ufs/ufs/dinode.h>
 #endif
+#include <sys/ioctl.h>
+#include <sys/mtio.h>
 
 #include <protocols/dumprestore.h>
 
@@ -424,6 +426,14 @@
        (void) close(tapefd);
        while ((f = open(tape, 0)) < 0)
                sleep (10);
+       if (eflag) {
+               struct mtop offl;
+
+               msg("Ejecting %s\n", tape);
+               offl.mt_op = MTOFFL;
+               offl.mt_count = 0;
+               (void) ioctl(f, MTIOCTOP, &offl);
+       }
        (void) close(f);
 }
 



Home | Main Index | Thread Index | Old Index