From owner-freebsd-bugs Thu Mar 1 6:20: 9 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B111437B719 for ; Thu, 1 Mar 2001 06:20:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f21EK1P26009; Thu, 1 Mar 2001 06:20:01 -0800 (PST) (envelope-from gnats) Received: from bakhtin.amt.ru (station113.amt.ru [212.111.64.113]) by hub.freebsd.org (Postfix) with ESMTP id E942C37B719 for ; Thu, 1 Mar 2001 06:13:16 -0800 (PST) (envelope-from bakhtin@amt.ru) Received: (from bakhtin@localhost) by bakhtin.amt.ru (8.11.2/8.11.2) id f21EDE201343; Thu, 1 Mar 2001 17:13:14 +0300 (MSK) (envelope-from bakhtin) Message-Id: <200103011413.f21EDE201343@bakhtin.amt.ru> Date: Thu, 1 Mar 2001 17:13:14 +0300 (MSK) From: bakhtin@amt.ru Reply-To: bakhtin@amt.ru To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: bin/25474: dump can't close fifo pipe correctly Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25474 >Category: bin >Synopsis: dump can't close fifo pipe correctly >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Mar 01 06:20:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: Alex Bakhtin >Release: FreeBSD 4.2-STABLE i386 >Organization: AMT Group >Environment: {bakhtin}/home/bakhtin/work/dump>uname -a FreeBSD bakhtin.amt.ru 4.2-STABLE FreeBSD 4.2-STABLE #1: Tue Feb 6 17:26:00 MSK 2001 root@bakhtin.amt.ru:/mnt/srcs/src/sys/compile/BAKHTIN i386 >Description: I'm trying to dump my filesystems to fifo pipe (created by mkfifo) and have got a problem. If we use dump -f FILE and FILE is fifo, it dumps fs fine, but after that it fails to close this file. Looking into dump sources (tape.c file) I have found a problem: after closing the file it tries to reopen it several times: while ((f = open(tape, 0)) < 0) sleep (10); (void) close(f); And because nobody is listening at the other end of this pipe, we'll wait for a long time... >How-To-Repeat: mkfifo PIPE dd if=PIPE of=/dev/null& dump -0 -f PIPE / >Fix: {bakhtin}/home/bakhtin/work/dump>diff tape.c /usr/src/sbin/dump/tape.c 46d45 < #include ! 326d324 < struct stat sp; 369d366 < fstat(tapefd,&sp); 371d367 < if(S_ISFIFO(sp.st_mode)) return; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message