[v4,0/2] libcamera: process: Pass stderr and reserve stdin and stdout fds
mbox series

Message ID 20250527155615.560463-1-julien.vuillaumier@nxp.com
Headers show
Series
  • libcamera: process: Pass stderr and reserve stdin and stdout fds
Related show

Message

Julien Vuillaumier May 27, 2025, 3:56 p.m. UTC
Hello,

This is the v4 of this patch aimed at letting a child process to log
onto parent's stderr, and making sure that its stdin/stdout/stderr
fds are not free to reuse.

Change history:

v4:
- use _exit() instead of exit() in child process (comment from Barnabás)
- while at it, also change an existing exit() to _exit(), in case of
  execv() failure

v3: 
- Give the option to inherit from any standard file descriptor from
  the parent 
- Fix a possible self duplication of descriptors
- Fix the null device descriptor that unnecessarily remains opens

v2:
- Pass only parent's stderr to the child process for logging purpose
- Reallocate child's stdin/stdout file descriptors to /dev/null (daemon style) so
  that they are not recycled for other usage

Thanks,
Julien

Julien Vuillaumier (2):
  libcamera: process: Use _exit in child process
  libcamera: process: Pass stderr and reserve stdin and stdout fds

 src/libcamera/process.cpp | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)