Date: Wed, 19 Nov 2003 08:21:10 -0800 From: Wes Peters <wes@softweyr.com> To: Sheldon Hearn <sheldonh@starjuice.net>, Wes Peters <wes@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sbin/fsck_ffs setup.c Message-ID: <200311190821.10350.wes@softweyr.com> In-Reply-To: <20031119095138.GA752@starjuice.net> References: <200311160710.hAG7AtRR047311@repoman.freebsd.org> <20031119095138.GA752@starjuice.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311190821.10350.wes>
