From owner-cvs-all@FreeBSD.ORG Sat Dec 27 07:34:32 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 507C616A4CE; Sat, 27 Dec 2003 07:34:32 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id D318843D45; Sat, 27 Dec 2003 07:34:29 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id CAA03617; Sun, 28 Dec 2003 02:34:06 +1100 Date: Sun, 28 Dec 2003 02:34:05 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Andrey Chernov In-Reply-To: <20031227140214.GA61469@nagual.pp.ru> Message-ID: <20031228020556.G1733@gamplex.bde.org> References: <200312271354.hBRDs3CN092828@repoman.freebsd.org> <20031227140214.GA61469@nagual.pp.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@freebsd.org cc: src-committers@freebsd.org cc: Bruce Evans cc: cvs-all@freebsd.org Subject: Re: cvs commit: src/sbin/fsck fsutil.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Dec 2003 15:34:32 -0000 On Sat, 27 Dec 2003, Andrey Chernov wrote: > On Sat, Dec 27, 2003 at 05:54:03AM -0800, Bruce Evans wrote: > > Declare perror(). We define and use a home made version of perror(3) > > that can't simply be removed (although it has the same interface as > > perror(3)) since it is very different (it prints on stdout, doesn't > > always print the program name, and sometimes exits). Declare it to > > get a reminder of this brokenness when WARNS is increased enough. > > If it is called from fsck only, maybe better way is to rename it to > something like my_perror()? It is called mainly from fsck_msdosfs (and fsck_ext2fs in NetBSD). fsck_ffs doesn't use perror() or fsck/fsutil.c at all, at least in FreeBSD. It has its own fsutil.c and uses pfatal(), pwarn() and printf(). These interfaces are confusing in different ways (pfatal() is not always fatal ...). perror() is only used once in fsck(8), and this is just a bug in FreeBSD changes (fsck(8) otherwise uses only the normal err() family). This leaves fsck/fsutil.c only really used by fsck_msdosfs. fsck_msdosfs uses pfatal(), pwarn(), perror() and printf(). I think it shouldn't use more or different interfaces than fsck_ffs, so it shouldn't use perror() or fsck_ffs should use a better named and interaced version of perror(). Perhaps the latter -- fsck_ffs rarely reports strerror(errno), and fsck_msdosfs often reports this (via perror()) but it gives less detail than fsck_ffs since there is no way to pass a non-literal string to perror(). Bruce