From owner-freebsd-questions@FreeBSD.ORG Sun Oct 10 17:38:30 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EB91416A4CE for ; Sun, 10 Oct 2004 17:38:30 +0000 (GMT) Received: from daedalus.desk.pl (daedalus.desk.pl [62.233.238.17]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6A74343D49 for ; Sun, 10 Oct 2004 17:38:29 +0000 (GMT) (envelope-from creep@daedalus.desk.pl) Received: from localhost (localhost [127.0.0.1]) by daedalus.desk.pl (Postfix) with ESMTP id 8E03E366AA0 for ; Sun, 10 Oct 2004 19:31:18 +0200 (CEST) Received: from daedalus.desk.pl ([127.0.0.1]) by localhost (daedalus [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09355-10 for ; Sun, 10 Oct 2004 19:31:17 +0200 (CEST) Received: by daedalus.desk.pl (Postfix, from userid 1023) id 42CC1366866; Sun, 10 Oct 2004 19:31:17 +0200 (CEST) Date: Sun, 10 Oct 2004 19:31:17 +0200 From: Marcin Koziej To: freebsd-questions@freebsd.org Message-ID: <20041010173117.GA5850@daedalus.desk.pl> References: <20041007155819.5928916A4D0@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <20041007155819.5928916A4D0@hub.freebsd.org> User-Agent: Mutt/1.4.1i X-Antivirus: Skaner Antywirusowy DESK.pl Subject: [PATCH] boot0cnf - broken? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 Oct 2004 17:38:31 -0000 FreeBSD 5.2.1-RELEASE-p9 #1: Thu Aug 12 19:39:05 CEST 2004 When wanted to make a simple boot fd using boot0cfg, i got error: boot0cfg: write_mbr: /dev/fd0: No such file or directory truss revealed that open("/dev/fd0",O_WRONLY,0666) failed with ERR#16 'Device busy'. No wonder, fd0 was opened for reading just moment before in read_mbr and wasn't closed. A small change fixed boot0cfg: ================================================== --- boot0cfg.c Sun Oct 10 19:27:22 2004 +++ boot0cfg.c.ok Sun Oct 10 19:26:54 2004 @@ -244,6 +244,7 @@ *mbr = malloc(sizeof(buf)); memcpy(*mbr, buf, sizeof(buf)); + close(fd); return sizeof(buf); } ================================================== Can anybody check if this is an issue for FreeBSD 5.3 beta and if yes send a pr? m.