1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-31 03:12:44 +00:00

Exit with nonzero status if torrent fails to load.

Fixes ticket #195
This commit is contained in:
Josh Elsasser 2007-02-06 22:47:55 +00:00
parent 92fa92b8d4
commit 6197964d15

View file

@ -77,13 +77,13 @@ int main( int argc, char ** argv )
if( parseCommandLine( argc, argv ) )
{
printf( USAGE, argv[0], TR_DEFAULT_PORT );
return 1;
return EXIT_FAILURE;
}
if( showHelp )
{
printf( USAGE, argv[0], TR_DEFAULT_PORT );
return 0;
return EXIT_SUCCESS;
}
if( verboseLevel < 0 )
@ -104,7 +104,7 @@ int main( int argc, char ** argv )
if( bindPort < 1 || bindPort > 65535 )
{
printf( "Invalid port '%d'\n", bindPort );
return 1;
return EXIT_FAILURE;
}
/* Initialize libtransmission */
@ -114,7 +114,8 @@ int main( int argc, char ** argv )
if( !( tor = tr_torrentInit( h, torrentPath, 0, &error ) ) )
{
printf( "Failed opening torrent file `%s'\n", torrentPath );
goto failed;
tr_close( h );
return EXIT_FAILURE;
}
if( showInfo )
@ -252,11 +253,9 @@ int main( int argc, char ** argv )
cleanup:
tr_torrentClose( h, tor );
failed:
tr_close( h );
return 0;
return EXIT_SUCCESS;
}
static int parseCommandLine( int argc, char ** argv )