Date: Fri, 20 Nov 2020 11:58:06 +0000 From: =?utf-8?Q?me=5Figalic=2Eco_=28Mina_Gali=C4=87=29?= <phabric-noreply@FreeBSD.org> To: Phabricator <phabric-noreply@FreeBSD.org> Cc: dev-reviews@freebsd.org Subject: [Differential] D27161: growfs: use sysexits in place of err/errc/errx(1) Message-ID: <2a6afc3b5b58c936e5c730c694b06360@localhost.localdomain> In-Reply-To: <differential-rev-PHID-DREV-nrqz5mnmm4sh3c7c5eea-req@reviews.freebsd.org> References: <differential-rev-PHID-DREV-nrqz5mnmm4sh3c7c5eea-req@reviews.freebsd.org>
index | next in thread | previous in thread | raw e-mail
me_igalic.co added a comment. In D27161#609617 <https://reviews.freebsd.org/D27161#609617>, @jilles wrote: > My suggestion is to change all the exit statuses that were changed to sysexits codes here to 2 instead. > > "requested size %s is not larger than the current filesystem size %s" remains at 1 so that it can be checked for. > > This results in a pattern much like grep(1) and test(1): the exit status is 0 if the file system has been or would be (with `-N`) enlarged, 1 if the file system is already at its maximum size and >1 if an error occurred. In practice, the ">1" is always 2, but this allows future expansion; scripts should check for the value 1, not for the value 2. i can see one other class of error: recoverable error, caused by bogus input. the wrong size, unrecognised extension used on the size, or heck even, wrong partition (or inability to find the correct device, or supplying a non-UFS. all of these are recoverable, by correcting the input. however, they are not recoverable in scripts, as they are mostly human errors OS errors, OTOH, are almost never recoverable without a major operation (running out of RAM or space, etc etc) > Please add this to the man page as well. that's the plan. as soon as we have something solid. I'd also like to continue this work in other tools that you find need it REPOSITORY rS FreeBSD src repository CHANGES SINCE LAST ACTION https://reviews.freebsd.org/D27161/new/ REVISION DETAIL https://reviews.freebsd.org/D27161 EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: me_igalic.co, oshogbo Cc: oshogbo, jilles, 0mp, imp, #contributor_reviews_base, dev-reviewshelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2a6afc3b5b58c936e5c730c694b06360>
