Commit Graph

5 Commits

Author SHA1 Message Date
Laurent Pinchart
af4304e497 libcamera: process: Properly ignore unused result with gcc
Casting the return value of a function to (void) doesn't ignore the
unused result warning with gcc. Use a #pragma to fix this properly, to
fix compilation with _FORTIFY_SOURCE.

Fixes: df23ab95f3 ("libcamera: process: fix compilation on Chromium OS")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
2019-08-22 11:09:05 +03:00
Jacopo Mondi
119428fa1c libcamera: process: Fail loudly on isolate
Add an error debug message when disassociating part of a process
execution context using unshare fails.

As this is currently used to isolate a child process which is
immediately terminated silently if unshare fails, add a debug printout
and propagate up the error code to make the failure more visible.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
2019-07-31 15:29:56 +02:00
Paul Elder
bfbc25785f libcamera: process: fix error checking
The return value of a read() call is mistakenly checked for nonzero
rather than less than zero. Fix this.

Fixes: df23ab95f3 ("libcamera: process: fix compilation on Chromium OS")
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
2019-07-12 17:48:30 +09:00
Paul Elder
df23ab95f3 libcamera: process: fix compilation on Chromium OS
Commit 3d20beca66 ("libcamera: Add Process and ProcessManager
classes") causes the build to fail in the Chromium OS build environment,
because the return values of some function calls marked with the
__warn_unused_result__ attribute are ignored. Fix this.

Fixes: 3d20beca66 ("libcamera: Add Process and ProcessManager classes")
Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-12 17:37:44 +09:00
Paul Elder
3d20beca66 libcamera: Add Process and ProcessManager classes
Add a Process class to abstract a process, and a ProcessManager singleton
to monitor and manage the processes.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2019-07-12 16:32:29 +09:00