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>
This commit is contained in:
parent
9e6147d303
commit
119428fa1c
1 changed files with 9 additions and 1 deletions
|
@ -306,7 +306,15 @@ void Process::closeAllFdsExcept(const std::vector<int> &fds)
|
|||
|
||||
int Process::isolate()
|
||||
{
|
||||
return unshare(CLONE_NEWUSER | CLONE_NEWNET);
|
||||
int ret = unshare(CLONE_NEWUSER | CLONE_NEWNET);
|
||||
if (ret) {
|
||||
ret = -errno;
|
||||
LOG(Process, Error) << "Failed to unshare execution context: "
|
||||
<< strerror(-ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue