NetBSD-Bugs archive

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

Re: bin/38413: mt(1) print some junk output when using remote tape



The following reply was made to PR bin/38413; it has been noted by GNATS.

From: Takahiro Kambe <taca%back-street.net@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/38413: mt(1) print some junk output when using remote tape
Date: Mon, 23 May 2011 16:12:08 +0900 (JST)

 This is fairly an old problem and I sent wrong address long ago.
 
 The attached patch solves mt(1) shows illegal output which dosen't
 supported by rmt protocol.  And we should add a note to librmt(3) or
 mt(1) that not all mt(1)'s output are supported when using remote
 tape.
 
 -- 
 Takahiro Kambe <taca%back-street.net@localhost>
 
 Message-Id: <20080422.120322.59485195.taca%back-street.net@localhost>
 Subject: Re: bin/38413: mt(1) print some junk output when using remote tape
 Date: Tue, 22 Apr 2008 12:03:22 +0900 (JST)
 From: Takahiro Kambe <taca%back-street.net@localhost>
 To: gnats-admin%netbsd.org@localhost
 X-Mailer: Mew version 5.2 on Emacs 22.1 / Mule 5.0 (SAKAKI)
 X-Antivirus: Scanned by F-Prot Antivirus (http://www.f-prot.com)
 Content-Type: Text/Plain; charset=us-ascii
 Content-Transfer-Encoding: 7bit
 
 This is simple patch for librmt(3) which avoid return junk to mt(1).
 Works for me but it isn't tested well.
 
 
 Index: lib/librmt/rmtlib.c
 ===================================================================
 RCS file: /cvs/src-4/lib/librmt/rmtlib.c,v
 retrieving revision 1.1.1.1
 diff -u -p -d -u -r1.1.1.1 rmtlib.c
 --- lib/librmt/rmtlib.c        7 Feb 2007 01:42:25 -0000       1.1.1.1
 +++ lib/librmt/rmtlib.c        22 Apr 2008 01:40:50 -0000
 @@ -534,6 +534,7 @@ _rmt_ioctl(int fildes, unsigned long op,
        if (command(fildes, "S") == -1 || (rv = status(fildes)) == -1)
                return (-1);
  
 +      memset(arg, '\0', sizeof(struct mtget));
        for (rc = rv, p = arg; rc > 0; rc -= cnt, p += cnt) {
                if ((cnt = read(READ(fildes), p, rc)) <= 0) {
                        rmtabort(fildes);
 
 
 -- 
 Takahiro Kambe <taca%back-street.net@localhost>
 


Home | Main Index | Thread Index | Old Index