mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Made kernelinfo(1) a little more friendly on bad string name.
This commit is contained in:
parent
868ed43e05
commit
5e317c9726
1 changed files with 8 additions and 1 deletions
|
@ -67,7 +67,14 @@ int main(int argc, char* argv[])
|
|||
{
|
||||
retry:
|
||||
ssize_t ret = kernelinfo(argv[i], buf, bufsize);
|
||||
if ( ret < 0 ) { error(1, errno, "kernelinfo(\"%s\")", argv[i]); }
|
||||
if ( ret < 0 )
|
||||
{
|
||||
if ( errno == EINVAL )
|
||||
{
|
||||
error(1, 0, "%s: No such kernel string", argv[i]);
|
||||
}
|
||||
error(1, errno, "kernelinfo(\"%s\")", argv[i]);
|
||||
}
|
||||
if ( ret )
|
||||
{
|
||||
buf = (char*) realloc(buf, ret);
|
||||
|
|
Loading…
Reference in a new issue