From owner-cvs-all@FreeBSD.ORG Wed Nov 19 08:21:23 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 4218E16A4CE; Wed, 19 Nov 2003 08:21:23 -0800 (PST) Received: from smtp.omnis.com (smtp.omnis.com [216.239.128.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 15E7443F75; Wed, 19 Nov 2003 08:21:22 -0800 (PST) (envelope-from wes@softweyr.com) Received: from salty.rapid.stbernard.com (corp-2.ipinc.com [199.245.188.2]) by smtp-relay.omnis.com (Postfix) with ESMTP id C67525B653; Wed, 19 Nov 2003 08:20:36 -0800 (PST) From: Wes Peters Organization: Softweyr.com To: Sheldon Hearn , Wes Peters Date: Wed, 19 Nov 2003 08:21:10 -0800 User-Agent: KMail/1.5.2 References: <200311160710.hAG7AtRR047311@repoman.freebsd.org> <20031119095138.GA752@starjuice.net> In-Reply-To: <20031119095138.GA752@starjuice.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200311190821.10350.wes@softweyr.com> cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sbin/fsck_ffs setup.c 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: Wed, 19 Nov 2003 16:21:23 -0000 On Wednesday 19 November 2003 01:51, Sheldon Hearn wrote: > On (2003/11/15 23:10), Wes Peters wrote: > > FreeBSD src repository > > > > Modified files: > > sbin/fsck_ffs setup.c > > Log: > > Catch and report on filesystems that were interrupted during > > newfs, sporting the new 'BAD' magic number. Exit with a unique > > error code (11) so callers who care about this can respond > > appropriately. > > Can you document this unique error code gracefully so that authors of > such callers get clued in easily? > > Doing so will probably require choosing a reasonable, existing errno > and documenting its return in the DIAGNOSTICS section of fsck_ffs(8). > > That's the first place I'd look for something like this if I were the > author of a caller that cares. Yes, but it won't be an existing errno because the other exits are numerical and semi-sequential: main.c: exit(3); /* Cannot read superblock */ main.c: exit(4); /* Earlier background failed */ main.c: exit(5); /* Not running soft updates */ main.c: exit(6); /* Lacks kernel support */ main.c: exit(7); /* Filesystem clean, report it now */ Also found throughout the code: fsck.h:#define EEXIT 8 /* Standard error exit. */ fsutil.c: errx(EEXIT, "inoinfo: inumber %d out of range", inum); fsutil.c: errx(EEXIT, "cannot allocate buffer pool"); fsutil.c: errx(EEXIT, "cannot allocate buffer pool"); fsutil.c: errx(EEXIT, "deadlocked buffer pool"); fsutil.c: exit(EEXIT); ... And a lone flyer: fsutil.c: exit(12); I picked 11 to be similar to the fsutil.c usage immediately above. The current man page does not enumerate the meanings of the exit status, but I can do so if you feel it is important. If you want this in 5.2, let's ask re@ right away. -- "Where am I, and what am I doing in this handbasket?" Wes Peters wes@softweyr.com