Source-Changes-HG archive

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

[src/trunk]: src/sbin/dump Fix bug in new "e" option: only eject tape if it i...



details:   https://anonhg.NetBSD.org/src/rev/bdc13b73ccd6
branches:  trunk
changeset: 509759:bdc13b73ccd6
user:      tron <tron%NetBSD.org@localhost>
date:      Sat May 12 08:03:01 2001 +0000

description:
Fix bug in new "e" option: only eject tape if it is full, not if the dump
was finished.

diffstat:

 sbin/dump/dump.h |   4 ++--
 sbin/dump/main.c |   6 +++---
 sbin/dump/tape.c |  10 +++++-----
 3 files changed, 10 insertions(+), 10 deletions(-)

diffs (90 lines):

diff -r 4c3209f3113d -r bdc13b73ccd6 sbin/dump/dump.h
--- a/sbin/dump/dump.h  Sat May 12 07:32:17 2001 +0000
+++ b/sbin/dump/dump.h  Sat May 12 08:03:01 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dump.h,v 1.24 2001/05/07 21:17:48 tron Exp $   */
+/*     $NetBSD: dump.h,v 1.25 2001/05/12 08:03:01 tron Exp $   */
 
 /*-
  * Copyright (c) 1980, 1993
@@ -197,7 +197,7 @@
 void   close_rewind __P((void));
 void   dumpblock __P((daddr_t blkno, int size));
 void   startnewtape __P((int top));
-void   trewind __P((void));
+void   trewind __P((int));
 void   writerec __P((char *dp, int isspcl));
 
 void   Exit __P((int status));
diff -r 4c3209f3113d -r bdc13b73ccd6 sbin/dump/main.c
--- a/sbin/dump/main.c  Sat May 12 07:32:17 2001 +0000
+++ b/sbin/dump/main.c  Sat May 12 08:03:01 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.28 2001/05/07 21:17:48 tron Exp $   */
+/*     $NetBSD: main.c,v 1.29 2001/05/12 08:03:01 tron Exp $   */
 
 /*-
  * Copyright (c) 1980, 1991, 1993, 1994
@@ -43,7 +43,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.6 (Berkeley) 5/1/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.28 2001/05/07 21:17:48 tron Exp $");
+__RCSID("$NetBSD: main.c,v 1.29 2001/05/12 08:03:01 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -561,7 +561,7 @@
        msg("Date this dump completed:  %s", ctime(&tnow));
        msg("Average transfer rate: %d KB/s\n", xferrate / tapeno);
        putdumptime();
-       trewind();
+       trewind(0);
        broadcast("DUMP IS DONE!\7\7\n");
        msg("DUMP IS DONE\n");
        Exit(X_FINOK);
diff -r 4c3209f3113d -r bdc13b73ccd6 sbin/dump/tape.c
--- a/sbin/dump/tape.c  Sat May 12 07:32:17 2001 +0000
+++ b/sbin/dump/tape.c  Sat May 12 08:03:01 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tape.c,v 1.24 2001/05/07 21:17:48 tron Exp $   */
+/*     $NetBSD: tape.c,v 1.25 2001/05/12 08:03:01 tron 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.24 2001/05/07 21:17:48 tron Exp $");
+__RCSID("$NetBSD: tape.c,v 1.25 2001/05/12 08:03:01 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -377,7 +377,7 @@
 }
 
 void
-trewind()
+trewind(int eject)
 {
        int f;
        int got;
@@ -426,7 +426,7 @@
        (void) close(tapefd);
        while ((f = open(tape, 0)) < 0)
                sleep (10);
-       if (eflag) {
+       if (eflag && eject) {
                struct mtop offl;
 
                msg("Ejecting %s\n", tape);
@@ -440,7 +440,7 @@
 void
 close_rewind()
 {
-       trewind();
+       trewind(1);
        (void)do_stats();
        if (nexttape)
                return;



Home | Main Index | Thread Index | Old Index