[PATCH] dvgrab: set proper retval on error condition

Jarod Wilson <[email protected]>
Newsgroups gmane.comp.video.kino.devel
Organization Red Hat, Inc.
Message-ID <[email protected]>
Set retval to 1 if we get an error, to make life easier for folks
who wrap dvgrab to tell if something went wrong (rhbz #486061).

Signed-off-by: Jarod Wilson <[email protected]>

--- dvgrab-3.4/main.cc.orig	2009-03-19 16:12:55.417171454 -0400
+++ dvgrab-3.4/main.cc	2009-03-19 16:12:22.321109256 -0400
@@ -93,6 +93,8 @@ int rt_raisepri (int pri)
 
 int main( int argc, char *argv[] )
 {
+	int ret = 0;
+
 	fcntl( fileno( stderr ), F_SETFL, O_NONBLOCK );
 	try
 	{
@@ -137,13 +139,15 @@ int main( int argc, char *argv[] )
 	{
 		fprintf( stderr, "Error: %s\n", s.c_str() );
 		fflush( stderr );
+		ret = 1;
 	}
 	catch ( ... )
 	{
 		fprintf( stderr, "Error: unknown\n" );
 		fflush( stderr );
+		ret = 1;
 	}
 
 	fprintf( stderr, "\n" );
-	return 0;
+	return ret;
 }



-- 
Jarod Wilson
[email protected]

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.