[libcamera-devel,21/30] cam: Drop unneeded error check and message
diff mbox series

Message ID 20210707021941.20804-22-laurent.pinchart@ideasonboard.com
State Superseded
Headers show
Series
  • Multi-camera support in the cam application
Related show

Commit Message

Laurent Pinchart July 7, 2021, 2:19 a.m. UTC
The EventLoop::exec() function returns the exit code of the event loop,
not an error status. Drop the corresponding error check and error
message.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/cam/main.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Kieran Bingham July 12, 2021, 3:47 p.m. UTC | #1
On 07/07/2021 03:19, Laurent Pinchart wrote:
> The EventLoop::exec() function returns the exit code of the event loop,
> not an error status. Drop the corresponding error check and error
> message.

Should the event loop return code be propagated to the application
return code though?

It doesn't currently anyway so:

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/cam/main.cpp | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/src/cam/main.cpp b/src/cam/main.cpp
> index 2ef26353e712..19ed9837cf4f 100644
> --- a/src/cam/main.cpp
> +++ b/src/cam/main.cpp
> @@ -313,9 +313,7 @@ int CamApp::run()
>  
>  	if (options_.isSet(OptMonitor)) {
>  		std::cout << "Press Ctrl-C to interrupt" << std::endl;
> -		ret = loop_.exec();
> -		if (ret)
> -			std::cout << "Failed to run monitor loop" << std::endl;
> +		loop_.exec();
>  	}
>  
>  	return 0;
>
Laurent Pinchart July 12, 2021, 6:41 p.m. UTC | #2
Hi Kieran,

On Mon, Jul 12, 2021 at 04:47:05PM +0100, Kieran Bingham wrote:
> On 07/07/2021 03:19, Laurent Pinchart wrote:
> > The EventLoop::exec() function returns the exit code of the event loop,
> > not an error status. Drop the corresponding error check and error
> > message.
> 
> Should the event loop return code be propagated to the application
> return code though?

That's entirely up to us, if we consider there's a need to do so. It
wouldn't really serve any purpose right now.

> It doesn't currently anyway so:
> 
> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> >  src/cam/main.cpp | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/src/cam/main.cpp b/src/cam/main.cpp
> > index 2ef26353e712..19ed9837cf4f 100644
> > --- a/src/cam/main.cpp
> > +++ b/src/cam/main.cpp
> > @@ -313,9 +313,7 @@ int CamApp::run()
> >  
> >  	if (options_.isSet(OptMonitor)) {
> >  		std::cout << "Press Ctrl-C to interrupt" << std::endl;
> > -		ret = loop_.exec();
> > -		if (ret)
> > -			std::cout << "Failed to run monitor loop" << std::endl;
> > +		loop_.exec();
> >  	}
> >  
> >  	return 0;

Patch
diff mbox series

diff --git a/src/cam/main.cpp b/src/cam/main.cpp
index 2ef26353e712..19ed9837cf4f 100644
--- a/src/cam/main.cpp
+++ b/src/cam/main.cpp
@@ -313,9 +313,7 @@  int CamApp::run()
 
 	if (options_.isSet(OptMonitor)) {
 		std::cout << "Press Ctrl-C to interrupt" << std::endl;
-		ret = loop_.exec();
-		if (ret)
-			std::cout << "Failed to run monitor loop" << std::endl;
+		loop_.exec();
 	}
 
 	return 0;