summaryrefslogtreecommitdiffstats
path: root/sbin/dump
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/dump')
-rw-r--r--sbin/dump/tape.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c
index 807239a..10b05c9 100644
--- a/sbin/dump/tape.c
+++ b/sbin/dump/tape.c
@@ -43,6 +43,7 @@ static const char rcsid[] =
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/wait.h>
+#include <sys/stat.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
@@ -314,6 +315,7 @@ flushtape()
void
trewind()
{
+ struct stat sb;
int f;
int got;
@@ -358,6 +360,10 @@ trewind()
return;
}
#endif
+ if (fstat(tapefd, &sb) == 0 && S_ISFIFO(sb.st_mode)) {
+ (void)close(tapefd);
+ return;
+ }
(void) close(tapefd);
while ((f = open(tape, 0)) < 0)
sleep (10);
OpenPOWER on IntegriCloud