Skip site navigation (1)Skip section navigation (2)
Date:      27 Nov 2001 10:25:04 +0300
From:      Alex Bakhtin <bakhtin@amt.ru>
To:        iedowse@FreeBSD.org
Cc:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/25474: dump can't close fifo pipe correctly
Message-ID:  <81r8qk4qwf.fsf@bakhtin.amt.ru>
In-Reply-To: <200111211843.fALIhFl64754@freefall.freebsd.org>
References:  <200111211843.fALIhFl64754@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "i" == iedowse  writes:
Hi,

 i> Synopsis: dump can't close fifo pipe correctly
 i> State-Changed-From-To: open->feedback
 i> State-Changed-By: iedowse
 i> State-Changed-When: Wed Nov 21 10:41:10 PST 2001
 i> State-Changed-Why: 

 i> Could you supply a patch using the "-u" option to diff? Without
 i> some context it's difficult to see what is being changed. Making
 i> dump work with FIFOs seems like a useful addition.

        Np. The only change made is inside `trewind` function - if the file
is a FIFO it's not necessary to execute the following code:
---
        while ((f = open(tape, 0)) < 0)
                sleep (10);
---

=============
{bakhtin}/home/bakhtin/work/dump>diff -u tape.c /usr/src/sbin/dump/tape.c
--- tape.c      Thu Mar  1 16:53:00 2001
+++ /usr/src/sbin/dump/tape.c   Mon Oct  8 20:26:16 2001
@@ -36,14 +36,13 @@
 static char sccsid[] = "@(#)tape.c     8.4 (Berkeley) 5/1/95";
 #endif
 static const char rcsid[] =
-  "$FreeBSD: src/sbin/dump/tape.c,v 1.12 1999/08/28 00:12:39 peter Exp $";
+  "$FreeBSD: src/sbin/dump/tape.c,v 1.12.2.1 2001/08/01 06:29:35 obrien Exp $";
 #endif /* not lint */
 
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/wait.h>
-#include <sys/stat.h>
 #ifdef sunos
 #include <sys/vnode.h>
 
@@ -323,7 +322,6 @@
 {
        int f;
        int got;
-       struct stat sp;
 
        for (f = 0; f < SLAVES; f++) {
                /*
@@ -366,9 +364,7 @@
                return;
        }
 #endif
-       fstat(tapefd,&sp);
        (void) close(tapefd);
-       if(S_ISFIFO(sp.st_mode)) return;
        while ((f = open(tape, 0)) < 0)
                sleep (10);
        (void) close(f);
@@ -385,7 +381,7 @@
        (void)time((time_t *)&(tstart_changevol));
        if (!nogripe) {
                msg("Change Volumes: Mount volume #%d\n", tapeno+1);
-               broadcast("CHANGE DUMP VOLUMES!\7\7\n");
+               broadcast("CHANGE DUMP VOLUMES!\a\a\n");
        }
        while (!query("Is the new volume mounted and ready to go?"))
                if (query("Do you want to abort?")) {
{bakhtin}/home/bakhtin/work/dump>
=============

-- 
Best regards, -- Alex Bakhtin, CCIE #8439
AMT Group, Cisco Systems Gold Partner, http://www.amt.ru



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?81r8qk4qwf.fsf>