1
0
Fork 0
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:
Jonas 'Sortie' Termansen 2012-03-11 18:14:21 +01:00
parent 868ed43e05
commit 5e317c9726

View file

@ -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);