Mailinglist Archive: yast-devel (105 mails)

< Previous Next >
Re: [yast-devel] [PATCH] yast2 exit codes
  • From: Stefan Hundhammer <sh@xxxxxxx>
  • Date: Thu, 25 Sep 2008 14:23:09 +0200
  • Message-id: <200809251423.09999.sh@xxxxxxx>
On Donnerstag, 25. September 2008, Stanislav Visnovsky wrote:
Exit codes:
0 - everything fine
1 - too few arguments
5 - error in arguments
16 - generic client error
16 + x - client returned 'x' as exit code

By lucky coincidence, the UI uses exit codes that are consistent with this:

YUIComponent::setServerOptions(...)
{
...
else if ( strcmp( argv[i], "--macro" ) == 0 )
{
if ( i+1 >= argc )
{
y2error( "Missing arg for '--macro'" );
fprintf( stderr, "y2base: Missing argument for --macro\n" );
exit( 1 );
}
}

void YUI::topmostConstructorHasFinished()
{
...
if ( _withThreads )
{
if ( pipe( pipe_from_ui ) == 0 &&
pipe( pipe_to_ui ) == 0 )
{
...
}
else
{
yuiError() << "pipe() failed: errno: " << errno << " " << strerror(
errno ) << endl;
exit(2);
}
}


But we should remain aware that there might be more reasons for some part of
that complex framework to prematurely call exit(). Most of them are very
pathological cases, but they might still happen, and we should be careful to
avoid reporting them in misleading ways -- e.g., as "bad parameters" when
some syscall early in the start-up process failed.


CU
--
Stefan Hundhammer <sh@xxxxxxx> Penguin by conviction.
YaST2 Development
SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nürnberg)
Nürnberg, Germany
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups
References