cvs commit: src/sbin/fsck_ffs setup.c
Wes Peters
wes at softweyr.com
Wed Nov 19 08:21:23 PST 2003
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 at softweyr.com
More information about the cvs-src
mailing list