[U-Boot] exit(-1) function in U-Boot

Drasko DRASKOVIC drasko.draskovic at gmail.com
Tue Mar 17 13:49:54 CET 2009


Hi Wolfgang,

> When "something  is  wrong  within  TFTP",  the  respective  function
> returns an error code, which propagates upward and causes the running
> command  to terminate, so you automatically end up back in the U-Boot
> shell.

Yes, I agree but the caller might do something else before exits the
command, or not exit the command at all (maybe take another path, because
function return sucess), and it begins difficult for me to follow where the
error happened in the past. I am trying to avoid use of debugger for the
moment, so I hoped to set a few conditions like
if (error)
{
   perror ("error1");
   exit(-1);
}

Quite simple, so I can see where it breaks. Some kind of assert. (Is there
an assert in U-Boot?)

Letting it propagate upwards severall call on the stack... uh... I will be
lost where the error came from.

Thanks,
Drasko


More information about the U-Boot mailing list