X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=tape-src%2Ftapetype.c;h=385039eef8ea8805f08ae1c8def875c7cd2c6818;hb=d3b2175e084f88c8736ad7073eacbf4670147aec;hp=bf3673771fd209142602e9bee7f6e3be94c0ba2a;hpb=34197d9f46a5f4e944378cbb65fca32ee0eec7b9;p=debian%2Famanda diff --git a/tape-src/tapetype.c b/tape-src/tapetype.c index bf36737..385039e 100644 --- a/tape-src/tapetype.c +++ b/tape-src/tapetype.c @@ -233,6 +233,12 @@ do_pass( sProgName, tapedev, strerror(errno)); exit(1); } + if (((-1 == tapefd_close(fd)) || + (-1 == (fd = tape_open(tapedev, O_RDWR))))) { + fprintf(stderr, "%s: could not re-open %s: %s\n", + sProgName, tapedev, strerror(errno)); + exit(1); + } time(&start); @@ -292,6 +298,15 @@ do_pass0( exit(1); } + if (dorewind && + ((-1 == tapefd_close(fd)) || + (-1 == (fd = tape_open(tapedev, O_RDWR))))) { + fprintf(stderr, "%s: could not re-open %s: %s\n", + sProgName, tapedev, strerror(errno)); + exit(1); + } + + time(&start); blks = writeblocks(fd, size);