[libcamera-devel] [PATCH 05/14] test: event-thread: Fix compilation on Chromium OS

Jacopo Mondi jacopo at jmondi.org
Sun Aug 18 19:24:58 CEST 2019


Hi Laurent,

On Sun, Aug 18, 2019 at 04:13:20AM +0300, Laurent Pinchart wrote:
> Commit 92b4af98cd67 ("test: Add EventNotifier thread move test") causes
> the build to fail in the Chromium OS build environment, because the
> return values of the pipe() function marked with the
> __warn_unused_result__ attribute is ignored. Fix this.
>

Do we want to compile tests on CrOS?

> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  test/event-thread.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/test/event-thread.cpp b/test/event-thread.cpp
> index 714bc9845820..01120733eca4 100644
> --- a/test/event-thread.cpp
> +++ b/test/event-thread.cpp
> @@ -25,7 +25,11 @@ public:
>  	EventHandler()
>  		: notified_(false)
>  	{
> -		pipe(pipefd_);
> +		int ret = pipe(pipefd_);
> +		if (ret < 0) {
> +			ret = errno;
> +			cout << "pipe() failed: " << strerror(ret) << endl;
> +		}

Shouldn't we fail the test if creating the pipe fails?
This will require moving this out of the constructor probably...

>
>  		notifier_ = new EventNotifier(pipefd_[0], EventNotifier::Read, this);
>  		notifier_->activated.connect(this, &EventHandler::readReady);
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20190818/870b603b/attachment.sig>


More information about the libcamera-devel mailing list